globs: fix glob pattern on directories.
parent
5cfd5ff224
commit
f80057d4b0
|
@ -2,8 +2,8 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays combinators combinators.short-circuit
|
USING: accessors arrays combinators combinators.short-circuit
|
||||||
io.directories io.files io.files.info io.pathnames kernel locals
|
io.directories io.files io.files.info io.pathnames kernel locals
|
||||||
make peg.ebnf regexp regexp.combinators sequences splitting
|
make peg.ebnf regexp regexp.combinators sequences strings system
|
||||||
strings system unicode ;
|
unicode ;
|
||||||
IN: globs
|
IN: globs
|
||||||
|
|
||||||
: not-path-separator ( -- sep )
|
: not-path-separator ( -- sep )
|
||||||
|
@ -62,10 +62,10 @@ DEFER: glob-directory%
|
||||||
directory-entries [ name>> "." head? ] reject ;
|
directory-entries [ name>> "." head? ] reject ;
|
||||||
|
|
||||||
: ?glob-directory% ( root remaining entry -- )
|
: ?glob-directory% ( root remaining entry -- )
|
||||||
directory? [
|
over empty? [
|
||||||
glob-directory%
|
2drop ,
|
||||||
] [
|
] [
|
||||||
empty? [ , ] [ drop ] if
|
directory? [ glob-directory% ] [ 2drop ] if
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
:: glob-wildcard% ( root globs -- )
|
:: glob-wildcard% ( root globs -- )
|
||||||
|
|
Loading…
Reference in New Issue