From: Daniel Barlow Date: Wed, 29 Oct 2003 03:37:22 +0000 (+0000) Subject: 0.8.5.12 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e855e0537e05f315d26cf8778353a3be02ee760b;p=sbcl.git 0.8.5.12 SB-POSIX now converts pathnames to Unix filenames using SB-INT:UNIX-NAMESTRING, instead of to CL namestrings (which are not the same thing, especially when wildchard characters are involved) with NAMESTRING Bug report and fix both courtesy of Zach Beane. Thanks. --- diff --git a/contrib/sb-posix/macros.lisp b/contrib/sb-posix/macros.lisp index 00af8de..9f79a69 100644 --- a/contrib/sb-posix/macros.lisp +++ b/contrib/sb-posix/macros.lisp @@ -1,7 +1,14 @@ (in-package :sb-posix-internal) +;;; some explanation may be necessary. The namestring "[foo]" +;;; denotes a wild pathname. When there's a file on the disk whose +;;; Unix name is "[foo]", the appropriate CL namestring for it is +;;; "\\[foo]". So, don't call NAMESTRING, instead call a function +;;; that gets us the Unix name + (define-designator filename c-string - (pathname (namestring (translate-logical-pathname filename))) + (pathname + (sb-impl::unix-namestring (translate-logical-pathname filename) nil)) (string filename)) (define-designator file-descriptor (integer 32) diff --git a/contrib/sb-posix/posix-tests.lisp b/contrib/sb-posix/posix-tests.lisp index 2d7dd63..f8e92b6 100644 --- a/contrib/sb-posix/posix-tests.lisp +++ b/contrib/sb-posix/posix-tests.lisp @@ -205,3 +205,20 @@ (sb-posix:rmdir dir) (sb-posix:syscall-errno c)))) #.sb-posix::eacces) + +;;; see comment in filename's designator definition, in macros.lisp +(deftest filename-designator.1 + (progn + ;; we use run-program to bypass the wildcard quoting in the + ;; highlevel CL functions like OPEN + (sb-ext:run-program "touch" + (list + (format nil "~A/[foo].txt" + (namestring *test-directory*))) + :search t :wait t ) + ;; if this test fails, it will probably be with + ;; "System call error 2 (No such file or directory)" + (let ((*default-pathname-defaults* *test-directory*)) + (sb-posix:unlink (car (directory "*.txt"))))) + 0) + diff --git a/version.lisp-expr b/version.lisp-expr index a0b0e5d..2bcb03a 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.5.11" +"0.8.5.12"