Raymond Toy pushed to branch issue-157-directory-returns-all-files at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/code/filesys.lisp
    ... ... @@ -812,8 +812,11 @@
    812 812
     			     (progn
    
    813 813
     			       (format t "file = ~A~%" file)
    
    814 814
     			       (describe pathname))
    
    815
    -			     (when (%pathname-match-p (merge-pathnames file dir-path nil)
    
    816
    -						     pathname)
    
    815
    +			     ;; Use pathname-match-p so that we are
    
    816
    +			     ;; guaranteed to have directory and
    
    817
    +			     ;; pathname-match-p behave consistently.
    
    818
    +			     (when (%%pathname-match-p (merge-pathnames file dir-path)
    
    819
    +						       pathname)
    
    817 820
     			       (funcall function
    
    818 821
     					(concatenate 'string
    
    819 822
     						     directory
    

  • src/code/pathname.lisp
    ... ... @@ -1221,15 +1221,32 @@ a host-structure or string."
    1221 1221
     
    
    1222 1222
     (defun %%pathname-match-p (pathname wildname)
    
    1223 1223
       (macrolet ((frob (field &optional (op 'components-match ))
    
    1224
    -		   `(or (eq (,field wildname) :wild)
    
    1225
    -			(,op (,field pathname) (,field wildname)))))
    
    1226
    -	(and (or (null (%pathname-host wildname))
    
    1227
    -		 (eq (%pathname-host wildname) (%pathname-host pathname)))
    
    1228
    -	     (frob %pathname-device)
    
    1229
    -	     (frob %pathname-directory directory-components-match)
    
    1230
    -	     (frob %pathname-name)
    
    1231
    -	     (frob %pathname-type)
    
    1232
    -	     (frob %pathname-version))))
    
    1224
    +	       `(,op (,field pathname) (,field wildname))))
    
    1225
    +    #+nil
    
    1226
    +    (progn
    
    1227
    +      (describe pathname)
    
    1228
    +      (describe wildname))
    
    1229
    +    (and (or (null (%pathname-host wildname))
    
    1230
    +	     (eq (%pathname-host wildname) (%pathname-host pathname)))
    
    1231
    +	 (flet ((device-components-match (thing wild)
    
    1232
    +		  (or (eq thing wild)
    
    1233
    +		      (eq wild :wild)
    
    1234
    +		      ;; A device component of :unspecific matches
    
    1235
    +		      ;; nil.
    
    1236
    +		      (or (and (null thing) (eq wild :unspecific))
    
    1237
    +			  (and (eq thing :unspecific) (eq wild nil))))))
    
    1238
    +	   (frob %pathname-device device-components-match))
    
    1239
    +	 #+nil
    
    1240
    +	 (frob %pathname-device)
    
    1241
    +	 (frob %pathname-directory directory-components-match)
    
    1242
    +	 (frob %pathname-name)
    
    1243
    +	 (frob %pathname-type)
    
    1244
    +	 (flet ((version-components-match (thing wild)
    
    1245
    +		  (or (eq thing wild)
    
    1246
    +		      (eq wild :wild)
    
    1247
    +		      ;; A version component matches of :newest matches nil.
    
    1248
    +		      (compare-version-component thing wild))))
    
    1249
    +	   (frob %pathname-version version-components-match)))))
    
    1233 1250
     
    
    1234 1251
     ;; Like PATHNAME-MATCH-P but the pathnames should not be search-lists.
    
    1235 1252
     ;; Primarily intended for TRANSLATE-LOGICAL-PATHNAME and friends,