X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Funix.lisp;h=2f1888fa57f0de126c02ec59a4599dd28baffaf1;hb=f369c736b57608402903ce5c59be78a87ef23364;hp=7da7e555fb39ef778a59c692dff79f84c8f3f93b;hpb=3a2c2a2217f77e0d1a44a581c83e0311ebc2594a;p=sbcl.git diff --git a/src/code/unix.lisp b/src/code/unix.lisp index 7da7e55..2f1888f 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -831,10 +831,16 @@ previous timer after the body has finished executing" (defun unix-resolve-links (pathname) (declare (type simple-base-string pathname)) (aver (not (relative-unix-pathname? pathname))) + ;; KLUDGE: readlink and lstat are unreliable if given symlinks + ;; ending in slashes -- fix the issue here instead of waiting for + ;; libc to change... + (let ((len (length pathname))) + (when (and (plusp len) (eql #\/ (schar pathname (1- len)))) + (setf pathname (subseq pathname 0 (1- len))))) (/noshow "entering UNIX-RESOLVE-LINKS") (loop with previous-pathnames = nil do - (/noshow pathname previous-pathnames) - (let ((link (unix-readlink pathname))) + (/noshow pathname previous-pathnames) + (let ((link (unix-readlink pathname))) (/noshow link) ;; Unlike the old CMU CL code, we handle a broken symlink by ;; returning the link itself. That way, CL:TRUENAME on a