Skip to content
Permalink
Browse files
allow both "jar:file:./my.jar!/" and "jar:file:./my.jar!" as LOAD_PAT…
…H entries

this was a regression introduced with jruby-1.7.13 - fixes #2017

Sponsored by Lookout Inc.
  • Loading branch information
mkristian committed Nov 11, 2014
1 parent f4036ab commit 5b3c45b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
@@ -30,7 +30,8 @@ public static JarResource create(String pathname) {

int bang = sanitized.indexOf('!');
String jarPath = sanitized.substring(0, bang);
String entryPath = sanitized.substring(bang + 1);
// normalize path -- issue #2017
String entryPath = sanitized.substring(bang + 1).replace("//", "/");

// TODO: Do we really need to support both test.jar!foo/bar.rb and test.jar!/foo/bar.rb cases?
JarResource resource = createJarResource(jarPath, entryPath, false);
@@ -6,4 +6,10 @@ def test_jar_on_load_path
require 'test_jruby_1332.rb'
assert($jruby_1332)
end

def test_jar_on_load_path_with_trailing_slash
$LOAD_PATH << "test/test_jruby_1332.jar!/"
require 'test_jruby_1332.rb'
assert($jruby_1332)
end
end

0 comments on commit 5b3c45b

Please sign in to comment.