From 400bd5eaada02457e7ceb46d40c757af28c872e6 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 16 May 2010 22:02:10 -0400 Subject: [PATCH] Fix this to account for not dropping empty strings at the edges. --- collects/meta/tree/tree.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collects/meta/tree/tree.rkt b/collects/meta/tree/tree.rkt index 6d7e2d595a..1e89eabae8 100644 --- a/collects/meta/tree/tree.rkt +++ b/collects/meta/tree/tree.rkt @@ -113,13 +113,13 @@ [glob (regexp-replace* #rx#"//+" glob #"/")] ;; ignore "/" prefix (filter never uses the root path) [glob (regexp-replace #rx#"^/" glob #"")]) - (regexp-split #rx#"(?<=/)" glob))]) + (regexp-split #rx#"(?<=/)(?=.)" glob))]) ;; - xs is never null (`regexp-split' never returns null) ;; - an element without a trailing slash must be the last one ;; - an element with a trailing slash matches non-leaf nodes only, so need ;; to test subs for `*/' and `**/' ;; - 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 for a leaf is considered true, but (not: (lambda (t) ;; #t)) is also a predicate) => use #t for `r' in this case