diff options
author | tjr <tjr@FreeBSD.org> | 2002-06-14 09:53:11 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-06-14 09:53:11 +0000 |
commit | 5a8b5dcfa466e28d13a45b0c3d01ac60e2e64e25 (patch) | |
tree | 667d71f2044f3821dafe1fed63bdb614c3538185 /usr.bin | |
parent | 29924b60f3b7940b5cf7fa3619ff014480bbce61 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | usr.bin/tr/str.c | 3 |
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; |