[Openmcl-devel] question regarding pathname-match-p

Ralf Stoye stoye at stoye.com
Thu Jul 12 06:49:49 PDT 2018


Hello everyone,

using quickproject i noticed that pathname-match-p behaves different on
ccl than on scbl.

(PATHNAME-MATCH-P
#P"/home/rs/src/quicklisp/local-projects/hello-world/system.asd"
"system.asd")
-> nil

i see that the exact behaviour of this function is
"implementation-defined but should be consistent with directory"

just to be able to use quickproject i changed the definition to call
%pathname-match-directory only if the wildname specifies a directory.

How can i ensure not to break anything by doing so?
Is there a test-suite or some tests to ensure to be "consistent with
directory"?
If you agree to the change, i'll commit them to my fork of ccl...

;; here are the changes:
 (defun pathname-match-p (pathname wildname)
   "Pathname matches the wildname template?"
   (let ((path-host (pathname-host pathname))
-        (wild-host (pathname-host wildname)))
+        (wild-host (pathname-host wildname))
+    (wild-directory (pathname-directory wildname)))
     (and
      (%host-component-match-p path-host wild-host)
      (%component-match-p (pathname-device pathname)(pathname-device
wildname))
-     (%pathname-match-directory
-      (%std-directory-component (pathname-directory pathname) path-host)
-      (%std-directory-component (pathname-directory wildname) wild-host))
+     (if wild-directory
+     (%pathname-match-directory
+      (%std-directory-component (pathname-directory pathname) path-host)
+      (%std-directory-component (pathname-directory wildname) wild-host))
+     t)
      (%component-match-p (pathname-name pathname)(pathname-name wildname))
      (%component-match-p (pathname-type pathname)(pathname-type wildname))
      (%component-match-p (pathname-version pathname)(pathname-version
wildname)))))



More information about the Openmcl-devel mailing list