summaryrefslogtreecommitdiffstats
path: root/usr.bin/tr/str.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2003-08-03 22:02:49 +0000
committerache <ache@FreeBSD.org>2003-08-03 22:02:49 +0000
commita6e89181546a5545fb9cac0b700e9675521e1741 (patch)
tree6fa7c1f834c3f4fc3bd93796e20e66390ea2b8a2 /usr.bin/tr/str.c
parent049e0c4c3165458a9769435fd85d94df4f9e0b1d (diff)
downloadFreeBSD-src-a6e89181546a5545fb9cac0b700e9675521e1741.zip
FreeBSD-src-a6e89181546a5545fb9cac0b700e9675521e1741.tar.gz
1) Fix -C - it was broken since introduced, wrong array sorted
2) Fix last (repeated) char after [:class:], it was \0 in original code
Diffstat (limited to 'usr.bin/tr/str.c')
-rw-r--r--usr.bin/tr/str.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/tr/str.c b/usr.bin/tr/str.c
index 7d91e7b..151a4bd 100644
--- a/usr.bin/tr/str.c
+++ b/usr.bin/tr/str.c
@@ -101,10 +101,11 @@ next(s)
case SET:
case SET_UPPER:
case SET_LOWER:
- if ((s->lastch = s->set[s->cnt++]) == OOBCH) {
+ if ((ch = s->set[s->cnt++]) == OOBCH) {
s->state = NORMAL;
return (next(s));
}
+ s->lastch = ch;
return (1);
default:
return (0);
OpenPOWER on IntegriCloud