Changeset 10893

Show
Ignore:
Timestamp:
09/12/05 14:38:17 (3 years ago)
Author:
rtoy
Message:

Fix some issues with printing (make-pathname :directory '(:relative)),
which used to print as #p"", and with reading #p".", #p"./".

code/filesys.lisp:
o When parsing a unix namestring, delete any "." elements of the

directory list.

o If we've parsed a namestring such that the file name is ".", replace

that with :name NIL and adjust the :directory component
appropriately, because on Unix, "." can't be the name of a file.

o Make :directory '(:relative) be printed as "./"

code/pathname.lisp:
o If the :directory argument to MAKE-PATHNAME contains strings with

#\/, print a warning that this is not a valid element.

o Remove all "."'s from a :relative directory component.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/code/pathname.lisp

    r10722 r10869  
    733733                 (member :absolute dir)))) 
    734734      (when (and d (rest d) (member (second d) '(:up :back))) 
    735         (error 'file-error))) 
     735        ;; What should we put in the for pathname part of file-error? 
     736        ;; I'm just going to use the directory but removing the 
     737        ;; offending :up or :back.  Or would just (make-pathname) be 
     738        ;; enough? 
     739        ;; 
     740        ;; Or instead of checking here, we could check whenever we 
     741        ;; "use" the file system (CLHS 19.2.2.4.3).  But that's a lot 
     742        ;; harder to do. 
     743        (error 'simple-file-error 
     744               :pathname (make-pathname :directory (remove-if #'(lambda (x) 
     745                                                                  (member x '(:up :back))) 
     746                                                              dir)) 
     747               :format-control "Illegal pathname: ~ 
     748                                Directory with ~S immediately followed by ~S" 
     749               :format-arguments (list (first d) (second d))))) 
    736750     
    737751    (macrolet ((pick (var varp field)