Commit 6fd3151e authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Workaround duplicate entries returned by clisp for (directory-files "~/")

parent ffe14b71
Loading
Loading
Loading
Loading
+19 −16
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ Try to override the defaults to not resolving symlinks, if implementation allows
    "Given ENTRIES in a DIRECTORY, remove if the directory is logical
the entries which are physical yet when transformed by MERGER have a different TRUENAME.
This function is used as a helper to DIRECTORY-FILES to avoid invalid entries when using logical-pathnames."
    (remove-duplicates ;; on CLISP, querying ~/ will return duplicates
     (if (logical-pathname-p directory)
         ;; Try hard to not resolve logical-pathname into physical pathnames;
         ;; otherwise logical-pathname users/lovers will be disappointed.
@@ -181,7 +182,9 @@ This function is used as a helper to DIRECTORY-FILES to avoid invalid entries wh
                              ;; but isn't quite in CLISP, for it doesn't have :version :newest
                              (and u (equal (truename* u) (truename* f)) u)))
               :when p :collect p)
        entries))
         entries)
     :test 'pathname-equal))


  (defun directory-files (directory &optional (pattern *wild-file*))
    "Return a list of the files in a directory according to the PATTERN,