]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tr: add -A, for compatibility with AIX tr
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 3 Jan 2018 19:02:17 +0000 (11:02 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 3 Jan 2018 19:04:03 +0000 (11:04 -0800)
Problem reported by Michael (Bug#29946).
* src/tr.c (main): Add undocumented -A option.

src/tr.c

index 4f407f4b1805055746c60a823654aa130af01745..ae05192dc9dd0efc2baea2903fafe1e038ddd7c6 100644 (file)
--- a/src/tr.c
+++ b/src/tr.c
@@ -1705,10 +1705,16 @@ main (int argc, char **argv)
 
   atexit (close_stdout);
 
-  while ((c = getopt_long (argc, argv, "+cCdst", long_options, NULL)) != -1)
+  while ((c = getopt_long (argc, argv, "+AcCdst", long_options, NULL)) != -1)
     {
       switch (c)
         {
+        case 'A':
+          /* Undocumented option, for compatibility with AIX.  */
+          setlocale (LC_COLLATE, "C");
+          setlocale (LC_CTYPE, "C");
+          break;
+
         case 'c':
         case 'C':
           complement = true;