Raymond Toy pushed to branch issue-157-directory-returns-all-files at cmucl / cmucl
Commits: c3cd7841 by Raymond Toy at 2023-03-04T09:51:45-08:00 Remove commented out debugging code; fix up some comments
- - - - -
2 changed files:
- src/code/filesys.lisp - src/code/pathname.lisp
Changes:
===================================== src/code/filesys.lisp ===================================== @@ -786,10 +786,6 @@ (let ((name (%pathname-name pathname)) (type (%pathname-type pathname)) (version (%pathname-version pathname))) - #+nil - (progn - (format t "name, type = ~A ~A~%" name type) - (describe pathname)) (cond ((member name '(nil :unspecific)) (when (or (not verify-existence) (unix:unix-file-kind directory)) @@ -803,15 +799,11 @@ (dir-path (pathname directory))) (when dir (unwind-protect - (loop + (loop (let ((file (unix:read-dir dir))) (if file (unless (or (string= file ".") (string= file "..")) - #+nil - (progn - (format t "file = ~A~%" file) - (describe pathname)) ;; Use pathname-match-p so that we are ;; guaranteed to have directory and ;; pathname-match-p behave consistently. @@ -820,27 +812,7 @@ (funcall function (concatenate 'string directory - file))) - #+nil - (multiple-value-bind - (file-name file-type file-version) - (let ((*ignore-wildcards* t)) - (extract-name-type-and-version - file 0 (length file))) - ;; Match also happens if the file has - ;; no explicit version and we're asking - ;; for version :NEWEST, since that's - ;; what no version means. - (when (and (components-match file-name name) - (components-match file-type type) - (or (components-match file-version - version) - (and (eq file-version nil) - (eq version :newest)))) - (funcall function - (concatenate 'string - directory - file))))) + file)))) (return)))) (unix:close-dir dir))))) (t
===================================== src/code/pathname.lisp ===================================== @@ -1222,10 +1222,6 @@ a host-structure or string." (defun %%pathname-match-p (pathname wildname) (macrolet ((frob (field &optional (op 'components-match )) `(,op (,field pathname) (,field wildname)))) - #+nil - (progn - (describe pathname) - (describe wildname)) (and (or (null (%pathname-host wildname)) (eq (%pathname-host wildname) (%pathname-host pathname))) (flet ((device-components-match (thing wild) @@ -1236,15 +1232,13 @@ a host-structure or string." (or (and (null thing) (eq wild :unspecific)) (and (eq thing :unspecific) (eq wild nil)))))) (frob %pathname-device device-components-match)) - #+nil - (frob %pathname-device) (frob %pathname-directory directory-components-match) (frob %pathname-name) (frob %pathname-type) (flet ((version-components-match (thing wild) (or (eq thing wild) (eq wild :wild) - ;; A version component matches of :newest matches nil. + ;; A version component of :newest matches nil. (compare-version-component thing wild)))) (frob %pathname-version version-components-match)))))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/c3cd7841cc500f07a822ef15...