Skip to content

Instantly share code, notes, and snippets.

@mkristian
Created November 9, 2015 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkristian/db06735f737cefd808d2 to your computer and use it in GitHub Desktop.
Save mkristian/db06735f737cefd808d2 to your computer and use it in GitHub Desktop.
treat windows drive letters as protocol with absolute paths
diff --git a/core/src/main/java/org/jruby/RubyFile.java b/core/src/main/java/org/jruby/RubyFile.java
index 3bfc0b7..89658f1 100644
--- a/core/src/main/java/org/jruby/RubyFile.java
+++ b/core/src/main/java/org/jruby/RubyFile.java
@@ -482,7 +482,7 @@ public class RubyFile extends RubyIO implements EncodingCapable {
return getRuntime().newString(val.toString());
}
- private static String URI_PREFIX_STRING = "^(uri|jar|file|classpath):([^:/]+:([^:/]+:)?)?";
+ private static String URI_PREFIX_STRING = "^([a-z]|uri|jar|file|classpath):([^:/]+:([^:/]+:)?)?";
private static Pattern ROOT_PATTERN = Pattern.compile(URI_PREFIX_STRING + "/?/?$");
/* File class methods */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment