]> gitweb.factorcode.org Git - factor.git/commitdiff
terminfo: interpret shorts as signed integer and test if negative
authorJon Harper <jon.harper87@gmail.com>
Fri, 26 Apr 2013 18:05:39 +0000 (21:05 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 26 Apr 2013 18:24:40 +0000 (11:24 -0700)
extra/terminfo/terminfo.factor

index d90d07a82e92a254f0d2734867adfcfcddfa68f0..88734b2fd2a7011afab5aee8fd7ba1914807c39a 100644 (file)
@@ -36,7 +36,7 @@ C: <terminfo-header> terminfo-header
     boolean-bytes>> read [ 1 = ] { } map-as ;
 
 : read-shorts ( n -- seq' )
-    2 * read 2 <groups> [ le> dup 65534 >= [ drop f ] when ] map ;
+    2 * read 2 <groups> [ signed-le> dup 0 < [ drop f ] when ] map ;
 
 : align-even-bytes ( header -- )
     [ names-bytes>> ] [ boolean-bytes>> ] bi + odd?