Changeset 9992


Ignore:
Timestamp:
09/21/05 17:36:15 (16 years ago)
Author:
piso
Message:

Work in progress (tested).

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r9982 r9992  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: LogicalPathname.java,v 1.16 2005-09-18 17:51:23 piso Exp $
     5 * $Id: LogicalPathname.java,v 1.17 2005-09-21 17:36:15 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    100100            if (n.equals("*"))
    101101                name = Keyword.WILD;
    102             else
     102            else if (n.length() > 0)
    103103                name = new SimpleString(n.toUpperCase());
    104104        }
  • trunk/j/src/org/armedbear/lisp/Pathname.java

    r9983 r9992  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Pathname.java,v 1.90 2005-09-18 17:52:06 piso Exp $
     5 * $Id: Pathname.java,v 1.91 2005-09-21 17:35:49 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    116116        }
    117117        if (s.equals("..") || s.equals("../")) {
    118             directory = list2(Keyword.RELATIVE, Keyword.BACK);
     118            directory = list2(Keyword.RELATIVE, Keyword.UP);
    119119            return;
    120120        }
     
    786786        final boolean logical;
    787787        if (host != NIL) {
     788            if (host instanceof AbstractString)
     789                host = LogicalPathname.canonicalizeStringComponent((AbstractString)host);
    788790            if (LOGICAL_PATHNAME_TRANSLATIONS.get(host) == null) {
    789791                // Not a defined logical pathname host.
     
    10431045        throws ConditionThrowable
    10441046    {
    1045 //         if (pathname instanceof LogicalPathname || defaultPathname instanceof LogicalPathname)
    1046 //             signal(new LispError("Bad place for a logical pathname."));
    10471047        Pathname p;
    10481048        if (pathname instanceof LogicalPathname)
     
    10761076        else
    10771077            p.version = defaultVersion;
     1078        if (p instanceof LogicalPathname) {
     1079            // When we're returning a logical
     1080            p.device = Keyword.UNSPECIFIC;
     1081            if (p.directory.listp()) {
     1082                LispObject original = p.directory;
     1083                LispObject canonical = NIL;
     1084                while (original != NIL) {
     1085                    LispObject component = original.car();
     1086                    if (component instanceof AbstractString)
     1087                        component = LogicalPathname.canonicalizeStringComponent((AbstractString)component);
     1088                    canonical = canonical.push(component);
     1089                    original = original.cdr();
     1090                }
     1091                p.directory = canonical.nreverse();
     1092            }
     1093            if (p.name instanceof AbstractString)
     1094                p.name = LogicalPathname.canonicalizeStringComponent((AbstractString)p.name);
     1095            if (p.type instanceof AbstractString)
     1096                p.type = LogicalPathname.canonicalizeStringComponent((AbstractString)p.type);
     1097        }
    10781098        return p;
    10791099    }
Note: See TracChangeset for help on using the changeset viewer.