Update of /cvsroot/sbcl/sbcl/src/code
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26277/src/code
Modified Files:
unix.lisp
Log Message:
0.9.8.44:
Fix for (truename #p"/") (reported by tomppa on #lisp)
Index: unix.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/unix.lisp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- unix.lisp 10 Jan 2006 17:39:29 -0000 1.63
+++ unix.lisp 18 Jan 2006 12:57:48 -0000 1.64
@@ -889,8 +889,12 @@
;; 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
|