diff --git a/code/filesys.lisp b/code/filesys.lisp index 2327cc0ac6bdd908af0ec579d484eaaea91e13fc..e3c9b75444d3af80b658fe740e43017487056f50 100644 --- a/code/filesys.lisp +++ b/code/filesys.lisp @@ -6,7 +6,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/filesys.lisp,v 1.89 2005/09/12 14:38:17 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/filesys.lisp,v 1.90 2005/09/21 20:01:34 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -301,14 +301,25 @@ (setf absolute t) (setf (car first) new-start)) search-list))))) - (multiple-value-bind - (name type version) + (multiple-value-bind (name type version) (let* ((tail (car (last pieces))) (tail-start (car tail)) (tail-end (cdr tail))) (unless (= tail-start tail-end) (setf pieces (butlast pieces)) - (extract-name-type-and-version namestr tail-start tail-end))) + (cond ((string= namestr ".." :start1 tail-start :end1 tail-end) + ;; ".." is a directory. Add this piece to the + ;; list of pieces, and make the name/type/version + ;; nil. + (setf pieces (append pieces (list (cons tail-start tail-end)))) + (values nil nil nil)) + ((not (find-if-not #'(lambda (c) + (char= c #\.)) + namestr :start tail-start :end tail-end)) + ;; Got a bunch of dots. Make it a file of the same name, and type nil. + (values (subseq namestr tail-start tail-end) nil nil)) + (t + (extract-name-type-and-version namestr tail-start tail-end))))) ;; PVE: Make sure there are no illegal characters in the name ;; such as #\Null and #\/. (when (and (stringp name) diff --git a/code/pathname.lisp b/code/pathname.lisp index 3e271724678a6ccfeb6bd83bc5f5a95efc19ab01..c13c69df3ec859fd7b27c52dac17ca950570c7aa 100644 --- a/code/pathname.lisp +++ b/code/pathname.lisp @@ -4,7 +4,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pathname.lisp,v 1.77 2005/09/19 21:04:43 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pathname.lisp,v 1.78 2005/09/21 20:01:34 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -733,7 +733,10 @@ a host-structure or string." (check-component-validity type :pathname-type) (mapc #'(lambda (d) (check-component-validity d :directory)) - (cdr dir))) + (cdr dir)) + (when (and (stringp name) + (or (string= name "..") (string= name "."))) + (warn "Silly argument for a unix PATHNAME-NAME: ~S" name))) ;; More sanity checking (when dir