]> gitweb.factorcode.org Git - factor.git/commitdiff
xmode.catalog: fix find-mode so it works with full paths
authorJoe Groff <arcata@gmail.com>
Sat, 5 Jun 2010 22:07:45 +0000 (15:07 -0700)
committerJoe Groff <arcata@gmail.com>
Sat, 5 Jun 2010 22:08:02 +0000 (15:08 -0700)
basis/xmode/catalog/catalog.factor

index e576a672c2f35d4ac8296543d044e5fca61cbe91..9b337418b3a6543b3d9156755596daefae5db0ad 100644 (file)
@@ -1,7 +1,7 @@
 USING: xmode.loader xmode.utilities xmode.rules namespaces
 strings splitting assocs sequences kernel io.files xml memoize
-words globs combinators io.encodings.utf8 sorting accessors xml.data
-xml.traversal xml.syntax ;
+words globs combinators io.encodings.utf8 io.pathnames sorting
+accessors xml.data xml.traversal xml.syntax ;
 IN: xmode.catalog
 
 TUPLE: mode file file-name-glob first-line-glob ;
@@ -114,6 +114,7 @@ ERROR: mutually-recursive-rulesets ruleset ;
     [ 2drop t ] [ file-name-glob>> ?glob-matches ] if ;
 
 : find-mode ( file-name first-line -- mode )
+    [ file-name ] dip
     modes
     [ nip [ 2dup ] dip suitable-mode? ] assoc-find
     2drop [ 2drop ] dip [ "text" ] unless* ;