From 6a905b45604b7d4546e4f9f632b8685c3bda497a Mon Sep 17 00:00:00 2001 From: ftrvxmtrx Date: Sat, 26 Apr 2014 14:26:40 +0200 Subject: tr: fix 4-byte runes fix (thanks rsc) --- sys/src/cmd/tr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/src/cmd/tr.c b/sys/src/cmd/tr.c index 85c76935b..63532a4ab 100644 --- a/sys/src/cmd/tr.c +++ b/sys/src/cmd/tr.c @@ -92,7 +92,7 @@ delete(void) SETBIT(t, c); } - last = 0x10000; + last = Runemax+1; while (readrune(0, &c) > 0) { if(!BITSET(f, c) && (c != last || !BITSET(t,c))) { last = c; @@ -132,7 +132,7 @@ complement(void) else p[i] = i; } if (sflag){ - lastc = 0x10000; + lastc = Runemax+1; while (readrune(0, &from) > 0) { if (from > high) from = to; @@ -186,7 +186,7 @@ translit(void) SETBIT(t,to); } if (sflag){ - lastc = 0x10000; + lastc = Runemax+1; while (readrune(0, &from) > 0) { if (from <= high) from = p[from]; -- cgit v1.2.3