Skip to content

Commit cb4e52e

Browse files
committed
Fixes #2387.
absolute paths without drive letter don't work in windows
1 parent f131465 commit cb4e52e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/java/org/jruby/RubyFile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,8 @@ public IRubyObject fileOpenGeneric(ThreadContext context, IRubyObject filename,
12241224
MakeOpenFile();
12251225

12261226
openFile.setMode(fmode_p[0]);
1227-
openFile.setPath(RubyFile.get_path(context, filename).asJavaString());
1227+
openFile.setPath(adjustRootPathOnWindows(context.runtime,
1228+
RubyFile.get_path(context, filename).asJavaString(), context.runtime.getCurrentDirectory()));
12281229

12291230
sysopenInternal19(openFile.getPath(), oflags, perm);
12301231

0 commit comments

Comments
 (0)