]> gitweb.factorcode.org Git - factor.git/commitdiff
terminfo: cleaner, use %c on linux.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 26 Apr 2013 14:10:40 +0000 (07:10 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 26 Apr 2013 14:10:40 +0000 (07:10 -0700)
extra/terminfo/terminfo.factor

index b5be4a796943ca845d59353eb1f5a260ff0fb3ea..a9c453a8e64f5b71c256622116b9b116bcc83533 100644 (file)
@@ -65,9 +65,13 @@ PRIVATE>
 : file>terminfo ( path -- terminfo )
     binary [ read-terminfo ] with-file-reader ;
 
-: terminfo-path ( name -- path )
-    [ first os macosx? [ >hex ] when ] keep
-    "/usr/share/terminfo/%s/%s" sprintf ;
+HOOK: terminfo-path os ( name -- path )
+
+M: macosx terminfo-path ( name -- path )
+    [ first >hex ] keep "/usr/share/terminfo/%s/%s" sprintf ;
+
+M: linux terminfo-path ( name -- path )
+    [ first ] keep "/usr/share/terminfo/%c/%s" sprintf ;
 
 MEMO: terminfo-names ( -- names )
     "/usr/share/terminfo" [