From 6adc85c77b6287f154b628c913a3156bc83a5c10 Mon Sep 17 00:00:00 2001 From: Tim Bradshaw Date: Tue, 17 Oct 2023 14:12:20 +0100 Subject: [PATCH] Handle symlinks to directories in LispWorks If a symlink points to a directory, then LW will, if link transparency is false (which it is) return its name as a filename from directory: as a name whose file-namestring is not nil in other words. Deal with this in directory-entries by appending the name to the directory components. --- quicklisp/impl-util.lisp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/quicklisp/impl-util.lisp b/quicklisp/impl-util.lisp index efa78c3..9743185 100644 --- a/quicklisp/impl-util.lisp +++ b/quicklisp/impl-util.lisp @@ -247,9 +247,20 @@ quicklisp at CL startup." (directory (merge-pathnames *wild-entry* directory) #+scl :truenamep #+scl nil)) (:implementation lispworks - (directory (merge-pathnames *wild-entry* directory) + ;; if the directory is a symlink and link transparency is false + ;; then it will have filename components which should be the last + ;; element of the directory component. If that's the case then + ;; append them to the directory where they belong. + (let ((filename (file-namestring directory))) + (directory (merge-pathnames *wild-entry* + (if (not filename) + directory + (make-pathname + :directory (append (pathname-directory directory) + (list filename)) + :defaults directory))) #+lispworks :directories #+lispworks t - #+lispworks :link-transparency #+lispworks nil)) + #+lispworks :link-transparency #+lispworks nil))) (:implementation ecl (nconc (directory (merge-pathnames *wild-entry* directory)