ref: c74190cf17ecb51fc72464ea87d2768b053e7445
parent: ff817cab884de8ce7015a255c2ddfd27c3d0854d
author: ftrvxmtrx <devnull@localhost>
date: Sat Apr 26 10:26:40 EDT 2014
tr: fix 4-byte runes fix (thanks rsc)
--- a/sys/src/cmd/tr.c
+++ b/sys/src/cmd/tr.c
@@ -92,7 +92,7 @@
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 @@
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 @@
SETBIT(t,to);
}
if (sflag){- lastc = 0x10000;
+ lastc = Runemax+1;
while (readrune(0, &from) > 0) {if (from <= high)
from = p[from];
--
⑨