From f5b4ecc14a33fd6b7c980fc4d87ca4ffc877adbc Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 5 Jun 2010 15:07:45 -0700 Subject: [PATCH] xmode.catalog: fix find-mode so it works with full paths --- basis/xmode/catalog/catalog.factor | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/basis/xmode/catalog/catalog.factor b/basis/xmode/catalog/catalog.factor index e576a672c2..9b337418b3 100644 --- a/basis/xmode/catalog/catalog.factor +++ b/basis/xmode/catalog/catalog.factor @@ -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* ;