summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-10-30 19:20:05 -0700
committerMichael Forney <mforney@mforney.org>2016-10-30 19:29:39 -0700
commit993b66f270109391a45769ad329881699eedff42 (patch)
treefa8b438ef07888564ae236bab74110a8d0cd70c3
parentc13773b23b33b2c15962ee1ed912b461f7304de7 (diff)
terminus-font: Fix ucstoany.awk POSIX compatibility
POSIX says that numeric strings are those that can be parsed with strtod, or those that would be recognized as a NUMBER token, depending on the implementation. strtod supports hex strings, but POSIX says that implementations are not required to allow hex literals as NUMBER tokens. The awk used by oasis (onetrueawk) does appear to support hex NUMBER tokens, but gawk does not without --non-decimal-data or --posix.
-rw-r--r--desktop/terminus-font/ucstoany.awk7
1 files changed, 6 insertions, 1 deletions
diff --git a/desktop/terminus-font/ucstoany.awk b/desktop/terminus-font/ucstoany.awk
index 067a6249..24145a2e 100644
--- a/desktop/terminus-font/ucstoany.awk
+++ b/desktop/terminus-font/ucstoany.awk
@@ -1,4 +1,9 @@
-{ unimap[unimap_len++] = int("0x" $0) }
+{
+ d = 0
+ for (i = 1; i <= length($0); ++i)
+ d = d * 16 + index("0123456789ABCDEF", substr($0, i, 1)) - 1
+ unimap[unimap_len++] = d
+}
function readchar() {
name = $2