Changeset 10059


Ignore:
Timestamp:
09/28/05 17:50:09 (16 years ago)
Author:
piso
Message:

%MAKE-LOGICAL-PATHNAME: signal an error if the host is "".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/LogicalPathname.java

    r10015 r10059  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: LogicalPathname.java,v 1.19 2005-09-23 19:35:43 piso Exp $
     5 * $Id: LogicalPathname.java,v 1.20 2005-09-28 17:50:09 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    293293            String s = arg.getStringValue();
    294294            String h = getHostString(s);
    295             if (h != null && Pathname.LOGICAL_PATHNAME_TRANSLATIONS.get(new SimpleString(h)) != null) {
    296                 // A defined logical pathname host.
    297                 return new LogicalPathname(h, s.substring(s.indexOf(':') + 1));
     295            if (h != null) {
     296                if (h.length() == 0) {
     297                    // "The null string, "", is not a valid value for any
     298                    // component of a logical pathname." 19.3.2.2
     299                    return signal(new LispError("Invalid logical host name: \"" +
     300                                                h + '"'));
     301                }
     302                if (Pathname.LOGICAL_PATHNAME_TRANSLATIONS.get(new SimpleString(h)) != null) {
     303                    // A defined logical pathname host.
     304                    return new LogicalPathname(h, s.substring(s.indexOf(':') + 1));
     305                }
    298306            }
    299307            return signal(new TypeError("Logical namestring does not specify a host: \"" + s + '"'));
Note: See TracChangeset for help on using the changeset viewer.