Changeset 13299 for trunk/abcl/src/org


Ignore:
Timestamp:
05/27/11 05:46:28 (10 years ago)
Author:
Mark Evenson
Message:

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

Found and patched by Matthew Daniel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Pathname.java

    r13298 r13299  
    357357                                    + ": " + ex.toString()));
    358358                }
    359                 File file = new File(uri.getPath());
    360                 Pathname p = new Pathname(file.getPath());
     359                final String uriPath = uri.getPath();
     360                if (null == uriPath) {
     361                    error(new FileError("The URI has no path: " + uri));
     362                }
     363                final File file = new File(uriPath);
     364                final Pathname p = new Pathname(file.getPath());
    361365                this.host = p.host;
    362366                this.device = p.device;
     
    372376                uri = url.toURI().normalize();
    373377            } catch (URISyntaxException e) {
    374                 error(new LispError("Could form URI from "
     378                error(new LispError("Couldn't form URI from "
    375379                                    + "'" + url + "'"
    376380                                    + " because: " + e));
Note: See TracChangeset for help on using the changeset viewer.