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.
This commit is contained in:
Tim J. Robbins 2002-06-14 09:53:11 +00:00
parent dfac4f3695
commit e73c3d279c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98215

View File

@ -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;