From af5d0c363a52e787a4311a11f035209eecdc4115 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 21 Oct 2007 12:38:33 +0200 Subject: tr: do not reject an unmatched [:lower:] or [:upper:] in SET1. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- tests/tr/Test.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/tr') diff --git a/tests/tr/Test.pm b/tests/tr/Test.pm index 1bb9aca44..804c5cb38 100644 --- a/tests/tr/Test.pm +++ b/tests/tr/Test.pm @@ -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 -- cgit v1.2.3-54-g00ecf