shithub: riscv

Download patch

ref: 6a905b45604b7d4546e4f9f632b8685c3bda497a
parent: 4468438c7030af510f4dc836d1c4af4310149aa3
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];