Permalink
Browse files

case 236 - was calling directory with non-portable arguments (thanks …

…to Stelian Ionescu for reporting this)

darcs-hash:20081003033255-3cc5d-1f9d22cf0ecfa6c71d6dbd1eba994c8a327d4438.gz
  • Loading branch information...
1 parent ae96974 commit 9a0d88f598b7dbbf791d8779372a29e889c8ef0e @gwkkwg committed Oct 3, 2008
Showing with 35 additions and 30 deletions.
  1. +35 −30 dev/utilities/files.lisp
View
@@ -500,36 +500,41 @@ source."
:name (pathname-name directory-spec)
:type (pathname-type directory-spec)))))
:defaults directory-spec)))
- (let* ((wild-directory
- (make-pathname
- :name :wild
- :type :wild
- :directory (append (pathname-directory directory-spec)
- (list :wild-inferiors))
- :defaults directory-spec))
- (directories (sort
- (directory wild-directory :directories t :files nil)
- #'>
- :key (compose #'length #'namestring))))
- (mapc (lambda (directory)
- (when verbose?
- (format *debug-io* "~%;;; processing directory ~A" directory))
- (mapc (lambda (file)
- (when (probe-file file)
- (when verbose?
- (format *debug-io* "~%;; deleting ~A" file))
- (unless dry-run?
- (delete-file file))))
- (directory (make-pathname :name :wild
- :type :wild
- :defaults directory)))
- (when verbose?
- (format *debug-io* "~%;; deleting directory ~A" directory))
- (unless dry-run?
- (delete-file directory)))
- (append directories
- (list directory-spec)))
- (values nil)))
+ (flet ((directory-args ()
+ #+allegro
+ '(:directories t :files nil)
+ #-allegro
+ nil))
+ (let* ((wild-directory
+ (make-pathname
+ :name :wild
+ :type :wild
+ :directory (append (pathname-directory directory-spec)
+ (list :wild-inferiors))
+ :defaults directory-spec))
+ (directories (sort
+ (apply #'directory wild-directory (directory-args))
+ #'>
+ :key (compose #'length #'namestring))))
+ (mapc (lambda (directory)
+ (when verbose?
+ (format *debug-io* "~%;;; processing directory ~A" directory))
+ (mapc (lambda (file)
+ (when (probe-file file)
+ (when verbose?
+ (format *debug-io* "~%;; deleting ~A" file))
+ (unless dry-run?
+ (delete-file file))))
+ (directory (make-pathname :name :wild
+ :type :wild
+ :defaults directory)))
+ (when verbose?
+ (format *debug-io* "~%;; deleting directory ~A" directory))
+ (unless dry-run?
+ (delete-file directory)))
+ (append directories
+ (list directory-spec)))
+ (values nil))))
#+(or)
(defun directory-name-p (directory-spec)

0 comments on commit 9a0d88f

Please sign in to comment.