From 796263418b77094014f841760c1c477d1f82029c Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 4 Aug 2003 02:57:17 +0000 Subject: [PATCH] Special fix just for tr -[cC]s '[:upper:]' '[:lower:]' case (or vice versa): chars taken from s2 can be different this time due to lack of complex upper/lower processing, so fill string2 again to not miss some. --- usr.bin/tr/tr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index 91c0e9c9ab3f..a22ba136dc8e 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -291,6 +291,13 @@ endloop: for (cnt = 0; cnt < n; cnt++) { (void)next(&s2); string1[carray[cnt]] = s2.lastch; + /* + * Chars taken from s2 can be different this time + * due to lack of complex upper/lower processing, + * so fill string2 again to not miss some. + */ + if (sflag) + string2[s2.lastch] = 1; } }