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

mevenson at common-lisp.net mevenson at common-lisp.net
Sat Jun 4 20:26:51 UTC 2011


Author: mevenson
Date: Thu May 26 22:46:28 2011
New Revision: 13299

Log:
Produce FILE-ERROR when a 'file' schema URL-PATHNAME has no path component.

Found and patched by Matthew Daniel.

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

Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Pathname.java	Wed May 25 07:32:16 2011	(r13298)
+++ trunk/abcl/src/org/armedbear/lisp/Pathname.java	Thu May 26 22:46:28 2011	(r13299)
@@ -356,8 +356,12 @@
                                     + "'" + url.toString() + "'"
                                     + ": " + ex.toString()));
                 }
-                File file = new File(uri.getPath());
-                Pathname p = new Pathname(file.getPath());
+                final String uriPath = uri.getPath();
+                if (null == uriPath) {
+                    error(new FileError("The URI has no path: " + uri));
+                }
+                final File file = new File(uriPath);
+                final Pathname p = new Pathname(file.getPath());
                 this.host = p.host;
                 this.device = p.device;
                 this.directory = p.directory;
@@ -371,7 +375,7 @@
             try { 
                 uri = url.toURI().normalize();
             } catch (URISyntaxException e) {
-                error(new LispError("Could form URI from "
+                error(new LispError("Couldn't form URI from "
                                     + "'" + url + "'"
                                     + " because: " + e));
             }




More information about the armedbear-cvs mailing list