summaryrefslogtreecommitdiff
path: root/sys/src/cmd/htmlroff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-04-24 20:13:18 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-04-24 20:13:18 +0200
commit667010554b30c46e35b9cad62edcfa01e37e1576 (patch)
tree418f828288c6c5c5ba0e6a18775af855966579f0 /sys/src/cmd/htmlroff
parent78c7ba36a1a732c08fbb7e4f8b19d1bc825c5b7e (diff)
make all the commands agnostic about Rune width. (from sources)
Diffstat (limited to 'sys/src/cmd/htmlroff')
-rw-r--r--sys/src/cmd/htmlroff/char.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/src/cmd/htmlroff/char.c b/sys/src/cmd/htmlroff/char.c
index 842d08eaa..7a1bc6a8b 100644
--- a/sys/src/cmd/htmlroff/char.c
+++ b/sys/src/cmd/htmlroff/char.c
@@ -16,6 +16,12 @@ rune2html(Rune r)
if(r == '\n')
return L("\n");
+ if(((uint)r&~0xFFFF) != 0){
+ /* The cache must grow a lot to handle them */
+ fprint(2, "%s: can't handle rune '%C'\n", argv0, r);
+ return L("?");
+ }
+
if(tcscache[r>>8] && tcscache[r>>8][r&0xFF])
return tcscache[r>>8][r&0xFF];
@@ -59,7 +65,7 @@ rune2html(Rune r)
typedef struct Trtab Trtab;
struct Trtab
{
- char t[3];
+ char t[UTFmax];
Rune r;
};