Skip to content

Instantly share code, notes, and snippets.

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 marktriggs/7575352 to your computer and use it in GitHub Desktop.
Save marktriggs/7575352 to your computer and use it in GitHub Desktop.
Modify NormalSearcher to return URL-decoded path names.
From 6a41e8ab17081e3a96d595981c9acd531b67ab7a Mon Sep 17 00:00:00 2001
From: Mark Triggs <mark@dishevelled.net>
Date: Thu, 21 Nov 2013 12:35:00 +1100
Subject: [PATCH] Modify NormalSearcher to return URL-decoded path names.
When paths contained spaces, the presence of %20 characters would cause
problems further up the stack.
---
core/src/main/java/org/jruby/runtime/load/LoadService.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/src/main/java/org/jruby/runtime/load/LoadService.java b/core/src/main/java/org/jruby/runtime/load/LoadService.java
index 4f457be..a3c02f2 100644
--- a/core/src/main/java/org/jruby/runtime/load/LoadService.java
+++ b/core/src/main/java/org/jruby/runtime/load/LoadService.java
@@ -1351,7 +1351,7 @@ public class LoadService {
if (current.getJarEntry(canonicalEntry) != null) {
try {
URI resourceUri = new URI("jar", "file:" + jarFileName + "!/" + canonicalEntry, null);
- foundResource = new LoadServiceResource(resourceUri.toURL(), resourceUri.toString());
+ foundResource = new LoadServiceResource(resourceUri.toURL(), resourceUri.getSchemeSpecificPart());
debugLogFound(foundResource);
} catch (URISyntaxException e) {
throw runtime.newIOError(e.getMessage());
--
1.7.10.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment