Changeset 15449


Ignore:
Timestamp:
10/29/20 16:54:46 (3 years ago)
Author:
Mark Evenson
Message:

MAKE-PATHNAME normalizes types of device component

File:
1 edited

Legend:

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

    r15448 r15449  
    11951195                }
    11961196            } else {
    1197               p.setDevice(device);
     1197              if (device instanceof Cons) {
     1198                LispObject normalizedDevice = NIL;
     1199                if (device.car() instanceof SimpleString) {
     1200                  String rootNamestring = device.car().getStringValue();
     1201                  URLPathname root = new URLPathname();
     1202                  if (!isValidURL(rootNamestring)) {
     1203                    Pathname rootPathname = Pathname.create(rootNamestring);
     1204                    root = URLPathname.createFromFile(rootPathname);
     1205                  } else {
     1206                    root = URLPathname.create(rootNamestring);
     1207                  }
     1208                  normalizedDevice = normalizedDevice.push(root);
     1209                } else {
     1210                  normalizedDevice = normalizedDevice.push(device.car());
     1211                }
     1212                LispObject o = device.cdr();
     1213                while (!o.car().equals(NIL)) {
     1214                  Pathname next = coerceToPathname(o.car());
     1215                  normalizedDevice = normalizedDevice.push(next);
     1216                  o = o.cdr();
     1217                }
     1218                normalizedDevice = normalizedDevice.nreverse();
     1219                p.setDevice(normalizedDevice);
     1220              } else {
     1221                p.setDevice(device);
     1222              }
    11981223            }
    11991224        }
Note: See TracChangeset for help on using the changeset viewer.