1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 11:16:16 +02:00

tr: do not reject an unmatched [:lower:] or [:upper:] in SET1.

* NEWS: Mention this.
* src/tr.c (get_next) [RE_CHAR_CLASS]: Don't skip the loop when
processing [:lower:] and [:upper:].
(main): Require [:lower:] or [:upper:] in SET1 only when
when one of those is specified in SET2.
* tests/tr/Test.pm: Add tests for this fix.
Reported by Per Starbäck.

Signed-off-by: Jim Meyering <meyering@redhat.com>
This commit is contained in:
Jim Meyering
2007-10-21 12:38:33 +02:00
parent c365bafa81
commit af5d0c363a
5 changed files with 23 additions and 18 deletions

View File

@@ -135,6 +135,10 @@ my @tv = (
# Prior to coreutils-6.10, this would provoke a failed assertion.
['no-abort-1', '-c ' . q|a '[b*256]'|, 'abc', 'abb', 0],
# Up to coreutils-6.9, tr rejected an unmatched [:lower:] or [:upper:] in SET1.
['s1-lower', q|'[:lower:]' '[.*]'|, '#$%123abcABC', '#$%123...ABC', 0],
['s1-upper', q|'[:upper:]' '[.*]'|, '#$%123abcABC', '#$%123abc...', 0],
);
sub test_vector