Skip to content

Commit 71f70d5

Browse files
committed
Another Windows special case.
1 parent c67b948 commit 71f70d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/rdf/util/file.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ def self.open_file(filename_or_url, proxy: nil, headers: {}, verify_none: false,
323323
# Just use path if there's a file scheme. This leaves out a potential host, which isn't supported anyway.
324324
if url_no_frag_or_query.scheme == 'file'
325325
url_no_frag_or_query = url_no_frag_or_query.path
326+
if url_no_frag_or_query.match?(/^\/[A-Za-z]:/) && Gem.win_platform?
327+
# Turns "/D:foo" into "D:foo"
328+
url_no_frag_or_query = url_no_frag_or_query[1..-1]
329+
end
326330
end
327331

328332
Kernel.open(url_no_frag_or_query, "r", **options) do |file|

0 commit comments

Comments
 (0)