From: Daniel Barlow Date: Wed, 20 Mar 2002 21:44:04 +0000 (+0000) Subject: 0.7.1.48: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=9c6eaddaf292027c2db50350848e00e3d06cef0f;p=sbcl.git 0.7.1.48: Make UNIX-NAMESTRING merge pathnames with *default-pathname-defaults* to get rid of ugly special case for "", and hopefully to fix all the remaining bits of code that don't do pathname merging before they access the filesystem --- diff --git a/src/code/filesys.lisp b/src/code/filesys.lisp index ca9a19f..ca50147 100644 --- a/src/code/filesys.lisp +++ b/src/code/filesys.lisp @@ -726,33 +726,19 @@ ;;; Convert PATHNAME into a string that can be used with UNIX system ;;; calls, or return NIL if no match is found. Wild-cards are expanded. +;;; FIXME this should signal file-error if the pathname is wild, whether +;;; or not it turns out to have only one match. Fix post 0.7.2 (defun unix-namestring (pathname-spec &optional (for-input t)) - ;; The ordinary rules of converting Lispy paths to Unix paths break - ;; down for the current working directory, which Lisp thinks of as - ;; "" (more or less, and modulo ANSI's *DEFAULT-PATHNAME-DEFAULTS*, - ;; which unfortunately SBCL, as of sbcl-0.6.12.8, basically ignores) - ;; and Unix thinks of as ".". Since we're at the interface between - ;; Unix system calls and things like ENSURE-DIRECTORIES-EXIST which - ;; think the Lisp way, we perform the conversion. - ;; - ;; (FIXME: The *right* way to deal with this special case is to - ;; merge PATHNAME-SPEC with *DEFAULT-PATHNAME-DEFAULTS* here, after - ;; which it's not a relative pathname any more so the special case - ;; is no longer an issue. But until *DEFAULT-PATHNAME-DEFAULTS* - ;; works, we use this hack.) - (if (empty-relative-pathname-spec-p pathname-spec) - "." - ;; Otherwise, the ordinary rules apply. - (let* ((namestring (physicalize-pathname (pathname pathname-spec))) - (matches nil)) ; an accumulator for actual matches - (!enumerate-matches (match namestring nil :verify-existence for-input) - (push match matches)) - (case (length matches) - (0 nil) - (1 (first matches)) - (t (error 'simple-file-error - :format-control "~S is ambiguous:~{~% ~A~}" - :format-arguments (list pathname-spec matches))))))) + (let* ((namestring (physicalize-pathname (merge-pathnames pathname-spec))) + (matches nil)) ; an accumulator for actual matches + (!enumerate-matches (match namestring nil :verify-existence for-input) + (push match matches)) + (case (length matches) + (0 nil) + (1 (first matches)) + (t (error 'simple-file-error + :format-control "~S is ambiguous:~{~% ~A~}" + :format-arguments (list pathname-spec matches)))))) ;;;; TRUENAME and PROBE-FILE diff --git a/version.lisp-expr b/version.lisp-expr index 2a0de55..e9dda28 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.1.47" +"0.7.1.48"