Skip to content

Commit 6af6f90

Browse files
committed
[Truffle] Windows: File.absolute_path should only have /.
1 parent a5ad48a commit 6af6f90

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

truffle/src/main/java/org/jruby/truffle/nodes/core/FileNodes.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ public AbsolutePathNode(AbsolutePathNode prev) {
4747
public RubyString absolutePath(RubyString path) {
4848
notDesignedForCompilation();
4949

50-
return getContext().makeString(new File(path.toString()).getAbsolutePath());
50+
String absolute = new File(path.toString()).getAbsolutePath();
51+
52+
if (getContext().isRunningOnWindows()) {
53+
absolute = absolute.replace('\\', '/');
54+
}
55+
56+
return getContext().makeString(absolute);
5157
}
5258

5359
}

0 commit comments

Comments
 (0)