]> gitweb.factorcode.org Git - factor.git/commitdiff
globs: fix glob pattern on directories.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Apr 2016 20:10:24 +0000 (13:10 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Apr 2016 20:10:24 +0000 (13:10 -0700)
basis/globs/globs.factor

index 7e86708ba40716831f421ec9f4f105e5b6f6c3d8..e72cd007d6dd344bc706282da421e01f1dcd6301 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays combinators combinators.short-circuit
 io.directories io.files io.files.info io.pathnames kernel locals
-make peg.ebnf regexp regexp.combinators sequences splitting
-strings system unicode ;
+make peg.ebnf regexp regexp.combinators sequences strings system
+unicode ;
 IN: globs
 
 : not-path-separator ( -- sep )
@@ -62,10 +62,10 @@ DEFER: glob-directory%
     directory-entries [ name>> "." head? ] reject ;
 
 : ?glob-directory% ( root remaining entry -- )
-    directory? [
-        glob-directory%
+    over empty? [
+        2drop ,
     ] [
-        empty? [ , ] [ drop ] if
+        directory? [ glob-directory% ] [ 2drop ] if
     ] if ;
 
 :: glob-wildcard% ( root globs -- )