]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: include ctype.h selectively
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 28 Oct 2023 00:31:49 +0000 (17:31 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Oct 2023 07:58:04 +0000 (00:58 -0700)
Include ctype.h only in files that need it.  Many of its uses
are incorrect, as they assume single-byte locales.  The idea is
to remove the incorrect uses later, when there is time.
* src/chroot.c, src/csplit.c, src/dd.c, src/digest.c, src/dircolors.c:
* src/expand-common.c, src/expand.c, src/fmt.c, src/fold.c, src/ls.c:
* src/od.c, src/pinky.c, src/pr.c, src/ptx.c, src/seq.c:
* src/set-fields.c, src/split.c, src/stdbuf.c, src/test.c:
* src/tr.c, src/truncate.c, src/unexpand.c, src/wc.c:
Include ctype.h.
* src/system.h: Do not include ctype.h.

include ctype.h.o

24 files changed:
src/chroot.c
src/csplit.c
src/dd.c
src/digest.c
src/dircolors.c
src/expand-common.c
src/expand.c
src/fmt.c
src/fold.c
src/ls.c
src/od.c
src/pinky.c
src/pr.c
src/ptx.c
src/seq.c
src/set-fields.c
src/split.c
src/stdbuf.c
src/system.h
src/test.c
src/tr.c
src/truncate.c
src/unexpand.c
src/wc.c

index 6150af5cd34bca47f550a11768fb446368989e52..17af5ebe410257ed4c53292b37d19559bd707a36 100644 (file)
@@ -17,6 +17,7 @@
 /* Written by Roland McGrath.  */
 
 #include <config.h>
+#include <ctype.h>
 #include <getopt.h>
 #include <stdio.h>
 #include <sys/types.h>
index dca525aaf8694f8b20f78c9aba26282e137b0375..32fb96bcad26f3e8619c9ebc9ef56e6893dde09f 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <signal.h>
index 595b8755b9865d1f6f0db3a3cf17affe126a1b66..85ea26a3f3d3ebfa2959c214793d3b434fe305b1 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
@@ -18,6 +18,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <sys/types.h>
 #include <signal.h>
 #include <stdckdint.h>
index 1f36953081f5c175d7dbbbfa4e28507cc1d9066f..336392608a9381036ad8f6e975708213d49d4c2d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <getopt.h>
 #include <sys/types.h>
 
index 8a86efb76fc3ce5ea5daeec3da440e0fe55dc727..f9001de0779be830e6f2b671061b4a3b286d5131 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <sys/types.h>
 #include <fnmatch.h>
 #include <getopt.h>
index 89fa56acefd956b198abede0cad13adf110add09..16240802d00b116800c007c932fc93e412c18b95 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include "system.h"
index 0e74d0cf6ec66f03fb6fc9a6253aaaac31368e4a..00f2119c6c7fa3c29f5d6355dcf6a0a0c0c33cfd 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index ad7a9ce56a00d13bc87e7810b5c68cdf35dd973d..b6fe74630dfa50cefbe71dd1800d6c0126a2ced5 100644 (file)
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -17,6 +17,7 @@
 /* Written by Ross Paterson <rap@doc.ic.ac.uk>.  */
 
 #include <config.h>
+#include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <getopt.h>
index 5c0428d8084a7162a4ec28a3fe9e85a398ee19f0..1a38590976dbf013505d955ead252444308eead1 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index 769ae85a75b10f089011c703701b49f1301acd15..e16972d3eccc42b8d4e8206148ec187a36f3f4fc 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -36,6 +36,7 @@
    Greg Lee <lee@uhunix.uhcc.hawaii.edu>.  */
 
 #include <config.h>
+#include <ctype.h>
 #include <sys/types.h>
 
 #include <termios.h>
index 538175af78560cf236c41bfb190a3685c4d113c2..951e88652e1818c83a8d94afd4f8ba9cac9b4563 100644 (file)
--- a/src/od.c
+++ b/src/od.c
@@ -18,6 +18,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <stdckdint.h>
 #include <stdio.h>
 #include <getopt.h>
index db0d2557b4f96701aa65e478e4bb4af7969f00c2..8c872b2fe183300aaff5ff7681eaced9a8b04537 100644 (file)
@@ -17,6 +17,7 @@
 /* Created by hacking who.c by Kaveh Ghazi ghazi@caip.rutgers.edu */
 
 #include <config.h>
+#include <ctype.h>
 #include <getopt.h>
 #include <pwd.h>
 #include <stdckdint.h>
index 57361d629ac925e799756418a6166cde72c7067f..7e680e23c788b85bc6e5ce3172975e21c392876f 100644 (file)
--- a/src/pr.c
+++ b/src/pr.c
 
 #include <config.h>
 
+#include <ctype.h>
 #include <getopt.h>
 #include <stdckdint.h>
 #include <sys/types.h>
index 3cd84b2e95a6ea1283446ca366ab630aab93cf3d..c1524fed715940c0ac867b5f0569af15120117bf 100644 (file)
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -19,6 +19,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include "system.h"
index 2822d5c2cea7a637d7c1c31c477a1eb5bd00cdb5..96d14be1c76bcd808b4a4d70febe50e7f9b86975 100644 (file)
--- a/src/seq.c
+++ b/src/seq.c
@@ -17,6 +17,7 @@
 /* Written by Ulrich Drepper.  */
 
 #include <config.h>
+#include <ctype.h>
 #include <getopt.h>
 #include <stdio.h>
 #include <sys/types.h>
index b299280c0fea48bac1626b05bd3d5faa89c97075..a524b7fa4344f31f50d21df43b6c35d2423add42 100644 (file)
@@ -19,6 +19,7 @@
 #include <config.h>
 
 #include "system.h"
+#include <ctype.h>
 #include "quote.h"
 #include "set-fields.h"
 
index d2cd2323448d52afc4d395bdf9190627af1aaa56..f56a144a6b4f56260ff884c2d1242af5a6c62a8d 100644 (file)
@@ -21,6 +21,7 @@
    * support --suppress-matched as in csplit.  */
 #include <config.h>
 
+#include <ctype.h>
 #include <stdckdint.h>
 #include <stdio.h>
 #include <getopt.h>
index 1ec23cf8b862bb6992c51eff6a8619e8f6411f0c..51326ad4e29d2ec4829e499a8a7e0c985a7b294e 100644 (file)
@@ -17,6 +17,7 @@
 /* Written by Pádraig Brady.  */
 
 #include <config.h>
+#include <ctype.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index b4e0a727524e9d52e8d9a8c1e00edd205a0e0be1..8c2a4fd8bfa7def29eef2421ebb1c4eae4697cb2 100644 (file)
@@ -142,8 +142,6 @@ enum
 
 #include "timespec.h"
 
-#include <ctype.h>
-
 /* ISDIGIT differs from isdigit, as follows:
    - Its arg may be any int or unsigned int; it need not be an unsigned char
      or EOF.
index a4eb40a52313569dc68894a928a317307d6dc337..2bcb9abc8c6f02fbf0ec83a67e50a65661bab760 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include <config.h>
+#include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
 
index 625c275832b0ea4498a39f0cd3338caa934499c4..292aae1d47dce772fdb772d67793d1f921432633 100644 (file)
--- a/src/tr.c
+++ b/src/tr.c
@@ -18,6 +18,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <getopt.h>
index 4a828e1da4b492ffeb4574f9fe65fc36a158819d..040172c4d30012ac7e06186d6d50088402e1e75d 100644 (file)
@@ -21,6 +21,7 @@
    to better fit the "GNU" environment.  */
 
 #include <config.h>             /* sets _FILE_OFFSET_BITS=64 etc. */
+#include <ctype.h>
 #include <stdckdint.h>
 #include <stdio.h>
 #include <getopt.h>
index 5a2283fdd4429bfad76bfe9cf499315b194b41c1..46e943365eabf075c0fa0efd08f700b406cea59f 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index e69ad0d51fdb7d9e807438d718af5f490c560955..43170cf9b9c913b9e9caff42a7ede7bc67b53333 100644 (file)
--- a/src/wc.c
+++ b/src/wc.c
@@ -19,6 +19,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include <stdckdint.h>
 #include <stdio.h>
 #include <getopt.h>