Fix this to account for not dropping empty strings at the edges.
This commit is contained in:
parent
0ed8dcc020
commit
400bd5eaad
|
@ -113,13 +113,13 @@
|
||||||
[glob (regexp-replace* #rx#"//+" glob #"/")]
|
[glob (regexp-replace* #rx#"//+" glob #"/")]
|
||||||
;; ignore "/" prefix (filter never uses the root path)
|
;; ignore "/" prefix (filter never uses the root path)
|
||||||
[glob (regexp-replace #rx#"^/" glob #"")])
|
[glob (regexp-replace #rx#"^/" glob #"")])
|
||||||
(regexp-split #rx#"(?<=/)" glob))])
|
(regexp-split #rx#"(?<=/)(?=.)" glob))])
|
||||||
;; - xs is never null (`regexp-split' never returns null)
|
;; - xs is never null (`regexp-split' never returns null)
|
||||||
;; - an element without a trailing slash must be the last one
|
;; - an element without a trailing slash must be the last one
|
||||||
;; - an element with a trailing slash matches non-leaf nodes only, so need
|
;; - an element with a trailing slash matches non-leaf nodes only, so need
|
||||||
;; to test subs for `*/' and `**/'
|
;; to test subs for `*/' and `**/'
|
||||||
;; - things usually work out fine, but if it's the last element, then we
|
;; - things usually work out fine, but if it's the last element, then we
|
||||||
;; better return #t or #f rather a continuation predicate, since a
|
;; better return #t or #f rather than a continuation predicate, since a
|
||||||
;; predicate result will never be used and it will mess up (eg, a
|
;; predicate result will never be used and it will mess up (eg, a
|
||||||
;; predicate result for a leaf is considered true, but (not: (lambda (t)
|
;; predicate result for a leaf is considered true, but (not: (lambda (t)
|
||||||
;; #t)) is also a predicate) => use #t for `r' in this case
|
;; #t)) is also a predicate) => use #t for `r' in this case
|
||||||
|
|
Loading…
Reference in New Issue
Block a user