diff options
author | Jim Meyering <meyering@redhat.com> | 2008-01-05 23:55:01 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-01-06 00:09:29 +0100 |
commit | 6efd10462d8103208f4575f0b5edddf841c7d87c (patch) | |
tree | 8084cb4f82237f06a2e51d1c6cba9b34a38afc03 /tests | |
parent | df8c2bcfe0658af32ceb7fedd795e5359631ff84 (diff) | |
download | coreutils-6efd10462d8103208f4575f0b5edddf841c7d87c.tar.xz |
Avoid tr case-conversion failure in some locales.
* src/tr.c (skip_construct): New function.
(main): When processing a pair of case-converting classes, don't
iterate through the elements of each [:upper:] or [:lower:] class.
Reported by Gerald Pfeifer in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218>.
* tests/tr/Test.pm [tolower-F]: New test for the above fix.
[upcase-xtra, dncase-xtra]: New tests, for a related code path.
* NEWS: Mention the tr bug fix.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tr/Test.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tr/Test.pm b/tests/tr/Test.pm index 7b25a156e..cf7021397 100644 --- a/tests/tr/Test.pm +++ b/tests/tr/Test.pm @@ -139,8 +139,20 @@ my @tv = ( # 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], + +# Up to coreutils-6.9.91, this would fail with the diagnostic: +# tr: misaligned [:upper:] and/or [:lower:] construct +# with LC_CTYPE=en_US.iso88591. +['tolower-F',q|'[:upper:]' '[:lower:]'|, 'A', 'a', 0], + +# When doing a case-converting translation with something after the +# [:upper:] and [:lower:] elements, ensure that tr honors the following byte. +['upcase-xtra',q|'[:lower:].' '[:upper:]x'|, 'abc.', 'ABCx', 0], +['dncase-xtra',q|'[:upper:].' '[:lower:]x'|, 'ABC.', 'abcx', 0], ); +$Test::env{'tolower-F'} = ['LC_CTYPE=en_US.iso88591']; + sub test_vector { my $t; |