Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use URI to normalize path - avoid using the FileSystem (on Windows)
  • Loading branch information
mkristian committed Jan 19, 2015
1 parent 02fedfa commit 5950186
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/util/URLResource.java
Expand Up @@ -159,7 +159,7 @@ public static FileResource createClassloaderURI(Ruby runtime, String pathname) {
}
try
{
pathname = new URI("/" + pathname).normalize().getPath().replaceAll("^/(../)*", "");
pathname = new URI(pathname.replaceFirst("^/*", "/")).normalize().getPath().replaceAll("^/([.][.]/)*", "");
} catch (URISyntaxException e) {
pathname = pathname.replaceAll("^[.]?/+", "");
}
Expand Down

0 comments on commit 5950186

Please sign in to comment.