Changeset 11616


Ignore:
Timestamp:
02/01/09 19:24:13 (12 years ago)
Author:
vvoutilainen
Message:

Better matching in directory listing. There are
still cases where I can break it with my own
trees, but it doesn't list superfluous entries
with this patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/directory.lisp

    r11577 r11616  
    4545  (let* ((directory (pathname-directory pathname))
    4646   (first-wild (position-if #'wild-p directory))
    47    (wild (and first-wild (nthcdr first-wild directory)))
    48    (non-wild (or (and first-wild
    49           (nbutlast directory
    50               (- (length directory) first-wild))
    51           directory)))
     47   (wild (when first-wild (nthcdr first-wild directory)))
     48   (non-wild (if first-wild
     49           (nbutlast directory
     50         (- (length directory) first-wild))
     51           directory))
    5252   (newpath (make-pathname :directory non-wild
    5353         :name nil :type nil :defaults pathname))
     
    5858                                 (directory (pathname-directory pathname))
    5959                                 (rest-wild (cdr wild)))
    60                             (unless (file-namestring pathname)
    61                               (when rest-wild
    62                                 (setf directory (nconc directory rest-wild)))
    63                               (list-directories-with-wildcards
    64                                (make-pathname :directory directory
    65                                               :defaults newpath)))))
     60                            (unless (pathname-name pathname)
     61            (when (pathname-match-p (first (last directory)) (if (eql (car wild) :wild) "*" (car wild)))
     62        (when rest-wild
     63          (setf directory (nconc directory rest-wild)))
     64          (list-directories-with-wildcards
     65         (make-pathname :directory directory
     66            :defaults newpath))))))
    6667                        entries))))
    6768
Note: See TracChangeset for help on using the changeset viewer.