0.9.8.44:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 18 Jan 2006 12:57:46 +0000 (12:57 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 18 Jan 2006 12:57:46 +0000 (12:57 +0000)
Fix for (truename #p"/") (reported by tomppa on #lisp)

NEWS
src/code/unix.lisp
tests/pathnames.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 10eeab1..ad6e59d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ changes in sbcl-0.9.9 relative to sbcl-0.9.8:
   * bug fix: saving a core corrupted callbacks on x86/x86-64
   * bug fix: closed a loophole in metacircularity detection and
     grounding in the PCL implementation of CLOS.
+  * bug fix: TRUENAME on "/" no longer returns a relative pathname.
+    (reported by tomppa on #lisp)
   * optimization: major improvements to GC efficiency on GENCGC platforms
   * optimization: faster implementation of EQUAL
   * optimization: emit more efficient opcodes for some common 
index f4d0ef3..d4666d7 100644 (file)
@@ -889,8 +889,12 @@ SYSCALL-FORM. Repeat evaluation of SYSCALL-FORM if it is interrupted."
   ;; KLUDGE: readlink and lstat are unreliable if given symlinks
   ;; ending in slashes -- fix the issue here instead of waiting for
   ;; libc to change...
+  ;;
+  ;; but be careful!  Must not strip the final slash from "/".  (This
+  ;; adjustment might be a candidate for being transferred into the C
+  ;; code in a wrap_readlink() function, too.) CSR, 2006-01-18
   (let ((len (length pathname)))
-    (when (and (plusp len) (eql #\/ (schar pathname (1- len))))
+    (when (and (> len 1) (eql #\/ (schar pathname (1- len))))
       (setf pathname (subseq pathname 0 (1- len)))))
   (/noshow "entering UNIX-RESOLVE-LINKS")
   (loop with previous-pathnames = nil do
index 280334b..ae1745f 100644 (file)
                  (list* 'write-to-string pathname vars)
                  expected
                  actual))
+\f
+;;; we got (truename "/") wrong for about 6 months.  Check that it's
+;;; still right.
+(let ((pathname (truename "/")))
+  (assert (equalp pathname #p"/"))
+  (assert (equal (pathname-directory pathname) '(:absolute))))
 
 ;;;; success
index 4a76338..476138a 100644 (file)
@@ -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.9.8.43"
+"0.9.8.44"