[armedbear-cvs] r13460 - trunk/abcl/src/org/armedbear/lisp

mevenson at common-lisp.net mevenson at common-lisp.net
Thu Aug 11 15:44:30 UTC 2011


Author: mevenson
Date: Thu Aug 11 08:44:29 2011
New Revision: 13460

Log:
Fix loading from fasls under Windows with whitespace in pathname.

A bad regression presumably introduced r13533.

Found by @acelent on #abcl (and possibly Theam Yong Chew but I didn't
have time to properly respond to his last email).

Modified:
   trunk/abcl/src/org/armedbear/lisp/Load.java
   trunk/abcl/src/org/armedbear/lisp/Pathname.java

Modified: trunk/abcl/src/org/armedbear/lisp/Load.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Load.java	Thu Aug 11 08:44:20 2011	(r13459)
+++ trunk/abcl/src/org/armedbear/lisp/Load.java	Thu Aug 11 08:44:29 2011	(r13460)
@@ -158,7 +158,7 @@
                 n = "jar:" + n + "!/" + name + "."
                     + COMPILE_FILE_INIT_FASL_TYPE;
             } else {
-                n = "jar:file:" + n + "!/" + name + "."
+                n = "jar:file:" + Pathname.uriEncode(n) + "!/" + name + "."
                     + COMPILE_FILE_INIT_FASL_TYPE;
             }
             mergedPathname = new Pathname(n);

Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Pathname.java	Thu Aug 11 08:44:20 2011	(r13459)
+++ trunk/abcl/src/org/armedbear/lisp/Pathname.java	Thu Aug 11 08:44:29 2011	(r13460)
@@ -373,9 +373,13 @@
                                     + "'" + url.toString() + "'"
                                     + ": " + ex.toString()));
                 }
-                final String uriPath = uri.getPath();
+                String uriPath = uri.getPath();
                 if (null == uriPath) {
-                    error(new LispError("The URI has no path: " + uri));
+		    // We make an exception for forms like "file:z:/foo/path"
+		    uriPath = uri.getSchemeSpecificPart();
+		    if (uriPath == null || uriPath.equals("")) {
+		       error(new LispError("The URI has no path: " + uri));
+     		    }
                 }
                 final File file = new File(uriPath);
                 final Pathname p = new Pathname(file.getPath());




More information about the armedbear-cvs mailing list