]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
stdbuf: port to oddball toupper
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 28 Oct 2023 16:30:49 +0000 (09:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Oct 2023 07:58:04 +0000 (00:58 -0700)
* src/stdbuf.c: Do not include ctype.h.
(set_libstdbuf_options): Use c_toupper, not toupper,
since the C locale is intended here.

src/stdbuf.c

index 51326ad4e29d2ec4829e499a8a7e0c985a7b294e..65142fd8c199396c33175401b1ac3e8466728345 100644 (file)
@@ -17,7 +17,6 @@
 /* Written by Pádraig Brady.  */
 
 #include <config.h>
-#include <ctype.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -286,10 +285,10 @@ set_libstdbuf_options (void)
 
           if (*stdbuf[i].optarg == 'L')
             ret = asprintf (&var, "%s%c=L", "_STDBUF_",
-                            toupper (stdbuf[i].optc));
+                            c_toupper (stdbuf[i].optc));
           else
             ret = asprintf (&var, "%s%c=%zu", "_STDBUF_",
-                            toupper (stdbuf[i].optc),
+                            c_toupper (stdbuf[i].optc),
                             stdbuf[i].size);
           if (ret < 0)
             xalloc_die ();