summaryrefslogtreecommitdiffstats
path: root/usr.bin/tr
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-14 09:53:11 +0000
committertjr <tjr@FreeBSD.org>2002-06-14 09:53:11 +0000
commit5a8b5dcfa466e28d13a45b0c3d01ac60e2e64e25 (patch)
tree667d71f2044f3821dafe1fed63bdb614c3538185 /usr.bin/tr
parent29924b60f3b7940b5cf7fa3619ff014480bbce61 (diff)
downloadFreeBSD-src-5a8b5dcfa466e28d13a45b0c3d01ac60e2e64e25.zip
FreeBSD-src-5a8b5dcfa466e28d13a45b0c3d01ac60e2e64e25.tar.gz
Don't treat the trailing ']' of an equivalence class expression as a
character in the set. tr -d '[=a=]' was deleting ]'s as well as a's. Noticed by the textutils test suite.
Diffstat (limited to 'usr.bin/tr')
-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 90f7335..1df43dc 100644
--- a/usr.bin/tr/str.c
+++ b/usr.bin/tr/str.c
@@ -227,10 +227,12 @@ genequiv(s)
s->equiv[0] = backslash(s);
if (*s->str != '=')
errx(1, "misplaced equivalence equals sign");
+ s->str += 2;
} else {
s->equiv[0] = s->str[0];
if (s->str[1] != '=')
errx(1, "misplaced equivalence equals sign");
+ s->str += 3;
}
/*
@@ -254,7 +256,6 @@ genequiv(s)
s->equiv[p] = OOBCH;
}
- s->str += 2;
s->cnt = 0;
s->state = SET;
s->set = s->equiv;
OpenPOWER on IntegriCloud