diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-06-14 09:53:11 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-06-14 09:53:11 +0000 |
commit | e73c3d279c51a131f03d518364b61cb7a3a40296 (patch) | |
tree | 667d71f2044f3821dafe1fed63bdb614c3538185 /usr.bin/tr | |
parent | dfac4f3695ed938aee62fbb9a9abfb842e36fac2 (diff) | |
download | src-e73c3d279c51a131f03d518364b61cb7a3a40296.tar.gz src-e73c3d279c51a131f03d518364b61cb7a3a40296.zip |
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.
Notes
Notes:
svn path=/head/; revision=98215
Diffstat (limited to 'usr.bin/tr')
-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 90f733585572..1df43dcc6556 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; |