summaryrefslogtreecommitdiff
path: root/src/test.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2010-09-27 07:16:44 +0100
committerPádraig Brady <P@draigBrady.com>2010-09-29 11:05:12 +0100
commit3f48829c2939e53c7e961a42d0749765dc076279 (patch)
tree094154a9b97b0ee973440a915f9fc67474b3c796 /src/test.c
parent704eedab034e24814067c535d3577f165c9a8b68 (diff)
downloadcoreutils-3f48829c2939e53c7e961a42d0749765dc076279.tar.xz
tr: fix various issues with case conversion
This valid translation spec aborted: LC_ALL=en_US.iso-8859-1 tr '[:upper:]- ' '[:lower:]_' This invalid translation spec aborted: LC_ALL=en_US.iso-8859-1 tr '[:upper:] ' '[:lower:]' This was caused by commit 6efd1046, 05-01-2008, "Avoid tr case-conversion failure in some locales" This misaligned conversion spec was allowed: LC_ALL=C tr 'A-Y[:lower:]' 'a-z[:upper:]' This was caused by commit af5d0c36, 21-10-2007, "tr: do not reject an unmatched [:lower:] or [:upper:] in SET1" This misaligned spec was allowed by extending the class: LC_ALL=C tr '[:upper:] ' '[:lower:]' * src/tr.c (validate_case_classes): A new function to check alignment of case conversion classes. Also it adjusts the length of the sets so that locales with different numbers of upper and lower case characters, don't cause issues. (string2_extend): Disallow extending the case conversion class as in the above example. That is locale dependent and most likely not what the user wants. (validate): Do the simple test for "restricted" char classes earlier, so we don't redundantly do more expensive validation. (main): Remove the case class validation, and simplify. * tests/misc/tr-case-class: A new test to test the various alignment and locale issues, associated with case conversion. * tests/misc/tr: Move case conversion tests to new tr-case-class. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fixes.
Diffstat (limited to 'src/test.c')
0 files changed, 0 insertions, 0 deletions