summaryrefslogtreecommitdiffstats
path: root/usr.bin/tr
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2003-08-04 02:57:17 +0000
committerache <ache@FreeBSD.org>2003-08-04 02:57:17 +0000
commite98015074ac424b5e0a50991c7cf49dd395261ff (patch)
treeafc710b3f15820432af5bd73298fa387da0f26e4 /usr.bin/tr
parentf63ee25e0f71c959119d4a4fead47c8c4bc839d0 (diff)
downloadFreeBSD-src-e98015074ac424b5e0a50991c7cf49dd395261ff.zip
FreeBSD-src-e98015074ac424b5e0a50991c7cf49dd395261ff.tar.gz
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.
Diffstat (limited to 'usr.bin/tr')
-rw-r--r--usr.bin/tr/tr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c
index 91c0e9c..a22ba13 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;
}
}
OpenPOWER on IntegriCloud