]> gitweb.factorcode.org Git - factor.git/commitdiff
fix globs tests
authorJoe Groff <arcata@gmail.com>
Tue, 16 Feb 2010 18:33:21 +0000 (10:33 -0800)
committerJoe Groff <arcata@gmail.com>
Tue, 16 Feb 2010 18:40:23 +0000 (10:40 -0800)
basis/globs/globs.factor

index 72b686c3b1db7cc603037b055d9b7ab02b2dd4d1..9cd6a73891b4e95093dd6b54a80eb944ecb5f5a5 100644 (file)
@@ -1,11 +1,11 @@
 ! Copyright (C) 2007, 2009 Slava Pestov, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: sequences io.pathnames kernel regexp.combinators
-strings unicode.case peg.ebnf regexp arrays ;
+strings splitting system unicode.case peg.ebnf regexp arrays ;
 IN: globs
 
 : not-path-separator ( -- sep )
-    "[^" path-separator "]" 3append <regexp> ; foldable
+    os windows? R! [^/\\]! R! [^/]! ? ; foldable
 
 EBNF: <glob>
 
@@ -48,5 +48,5 @@ Main = Concatenation End
     [ "\\*?[{" member? ] any? ;
 
 : glob-parent-directory ( glob -- parent-directory )
-    path-components dup [ glob-pattern? ] find drop head
+    path-separator split harvest dup [ glob-pattern? ] find drop head
     path-separator join ;