Changeset 15375
- Timestamp:
- 09/09/20 17:09:43 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/pathnames.lisp
r15369 r15375 55 55 (let ((testfunc (if ignore-case #'equalp #'equal))) 56 56 (labels ((split-string (delim str) 57 58 57 (flet ((finder (char) (find char delim))) 58 (loop 59 59 :for x = (position-if-not #'finder str) 60 60 :then (position-if-not #'finder str :start (or y (length str))) 61 61 :for y = (position-if #'finder str :start (or x (length str))) 62 62 :then (position-if #'finder str :start (or x (length str))) 63 63 :while x 64 65 66 67 68 69 70 71 72 73 74 75 76 64 :collect (subseq str x y)))) 65 (positions-larger (thing substrings previous-pos) 66 (let ((new-pos (search (car substrings) 67 thing 68 :start2 previous-pos 69 :test testfunc))) 70 (or 71 (not substrings) 72 (and new-pos 73 (>= new-pos previous-pos) 74 (positions-larger thing 75 (cdr substrings) 76 new-pos)))))) 77 77 (let ((split-result (split-string "*" wild))) 78 79 80 81 82 83 84 85 86 87 78 (and (positions-larger thing split-result 0) 79 (if (eql (elt wild 0) #\*) 80 t 81 (eql (search (first split-result) thing :test testfunc) 0)) 82 (if (eql (elt wild (1- (length wild))) #\*) 83 t 84 (let ((last-split-result (first (last split-result)))) 85 (eql (search last-split-result thing :from-end t 86 :test testfunc) 87 (- (length thing) (length last-split-result)))))))))) 88 88 89 89 (defun component-match-p (thing wild ignore-case) … … 93 93 t) 94 94 ((and (stringp wild) (position #\* wild)) 95 95 (component-match-wild-p thing wild ignore-case)) 96 96 (ignore-case 97 97 (equalp thing wild))
Note: See TracChangeset
for help on using the changeset viewer.