Skip to content
Permalink
Browse files
[Truffle] Fixed directory globbing on Windows.
  • Loading branch information
nirvdrum committed Dec 31, 2014
1 parent 2008fd8 commit fb9199f5a5bf03ab04e88ef14c2b98f02aeca12e
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/src/main/java/org/jruby/truffle/nodes/core/DirNodes.java
@@ -123,7 +123,8 @@ private static RubyArray glob(final RubyContext context, String glob) {

final String prefix = absoluteGlob.substring(0, prefixLength - 1);

final PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:" + absoluteGlob.substring(prefixLength));
// Glob patterns must always use '/', even on Windows.
final PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:" + absoluteGlob.substring(prefixLength).replace('\\', '/'));

final RubyArray array = new RubyArray(context.getCoreLibrary().getArrayClass());

0 comments on commit fb9199f

Please sign in to comment.