summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2026-01-04 15:11:57 +0000
committerPádraig Brady <P@draigBrady.com>2026-01-21 13:51:39 +0000
commit3ec554d4dd76b2560cb03d930b9381bebb3e99ea (patch)
tree91683ead20d0ca6b4132b37fa361779b006d1047 /src
parentcc002057b3a33d79db6ff3330783e5118b6f4479 (diff)
downloadcoreutils-3ec554d4dd76b2560cb03d930b9381bebb3e99ea.tar.gz
coreutils-3ec554d4dd76b2560cb03d930b9381bebb3e99ea.zip
doc: parse any whitespace as an option/description delimiter
* src/system.c (oputs_): Use isspace() rather than hardcoding. Note we don't use c_isspace() as we need to support anything coming from translations.
Diffstat (limited to 'src')
-rw-r--r--src/chroot.c1
-rw-r--r--src/csplit.c1
-rw-r--r--src/dd.c1
-rw-r--r--src/expand-common.c1
-rw-r--r--src/expand.c1
-rw-r--r--src/fmt.c1
-rw-r--r--src/fold.c1
-rw-r--r--src/ls.c1
-rw-r--r--src/numfmt.c1
-rw-r--r--src/od.c1
-rw-r--r--src/pinky.c1
-rw-r--r--src/pr.c1
-rw-r--r--src/ptx.c1
-rw-r--r--src/seq.c1
-rw-r--r--src/set-fields.c1
-rw-r--r--src/sort.c1
-rw-r--r--src/split.c1
-rw-r--r--src/system.h5
-rw-r--r--src/test.c1
-rw-r--r--src/tr.c1
-rw-r--r--src/truncate.c1
-rw-r--r--src/unexpand.c1
-rw-r--r--src/wc.c1
23 files changed, 3 insertions, 24 deletions
diff --git a/src/chroot.c b/src/chroot.c
index 8db28ecf2..48ef38d73 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -17,7 +17,6 @@
/* Written by Roland McGrath. */
#include <config.h>
-#include <ctype.h>
#include <getopt.h>
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/csplit.c b/src/csplit.c
index a28f2fa5f..2fdc5e819 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -19,7 +19,6 @@
#include <config.h>
-#include <ctype.h>
#include <getopt.h>
#include <sys/types.h>
#include <signal.h>
diff --git a/src/dd.c b/src/dd.c
index acb268aa4..ff3d42050 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -18,7 +18,6 @@
#include <config.h>
-#include <ctype.h>
#include <sys/types.h>
#include <signal.h>
diff --git a/src/expand-common.c b/src/expand-common.c
index afe613dc6..0d4f8955a 100644
--- a/src/expand-common.c
+++ b/src/expand-common.c
@@ -16,7 +16,6 @@
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
#include "system.h"
diff --git a/src/expand.c b/src/expand.c
index 8539da3e4..ef74ab0f6 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -34,7 +34,6 @@
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/fmt.c b/src/fmt.c
index 72b4d0adf..e7edb5735 100644
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -17,7 +17,6 @@
/* 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>
diff --git a/src/fold.c b/src/fold.c
index 09a7f144a..1a6432dea 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -18,7 +18,6 @@
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/ls.c b/src/ls.c
index 3fa04412a..8d28fe0ff 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -36,7 +36,6 @@
Greg Lee <lee@uhunix.uhcc.hawaii.edu>. */
#include <config.h>
-#include <ctype.h>
#include <sys/types.h>
#include <termios.h>
diff --git a/src/numfmt.c b/src/numfmt.c
index ac5cd9b7b..dbb008027 100644
--- a/src/numfmt.c
+++ b/src/numfmt.c
@@ -15,7 +15,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
-#include <ctype.h>
#include <float.h>
#include <getopt.h>
#include <stdio.h>
diff --git a/src/od.c b/src/od.c
index c421bd6da..725fa7278 100644
--- a/src/od.c
+++ b/src/od.c
@@ -18,7 +18,6 @@
#include <config.h>
-#include <ctype.h>
#include <endian.h>
#include <float.h>
#include <stdio.h>
diff --git a/src/pinky.c b/src/pinky.c
index 887b32fc4..bcc936ac8 100644
--- a/src/pinky.c
+++ b/src/pinky.c
@@ -17,7 +17,6 @@
/* 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 <stdio.h>
diff --git a/src/pr.c b/src/pr.c
index 5dfc58adb..fa395dc9c 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -309,7 +309,6 @@
#include <config.h>
-#include <ctype.h>
#include <getopt.h>
#include <sys/types.h>
#include "system.h"
diff --git a/src/ptx.c b/src/ptx.c
index 59e8508a6..5b6b30cf5 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -19,7 +19,6 @@
#include <config.h>
-#include <ctype.h>
#include <getopt.h>
#include <sys/types.h>
#include "system.h"
diff --git a/src/seq.c b/src/seq.c
index f72875862..2d3ff322d 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -17,7 +17,6 @@
/* Written by Ulrich Drepper. */
#include <config.h>
-#include <ctype.h>
#include <getopt.h>
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/set-fields.c b/src/set-fields.c
index 523549214..5b3264d35 100644
--- a/src/set-fields.c
+++ b/src/set-fields.c
@@ -19,7 +19,6 @@
#include <config.h>
#include "system.h"
-#include <ctype.h>
#include "c-ctype.h"
#include "quote.h"
#include "set-fields.h"
diff --git a/src/sort.c b/src/sort.c
index e5f31b179..c5bf44d31 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -22,7 +22,6 @@
#include <config.h>
-#include <ctype.h>
#include <getopt.h>
#include <pthread.h>
#include <sys/resource.h>
diff --git a/src/split.c b/src/split.c
index deeff03c3..9878c09f3 100644
--- a/src/split.c
+++ b/src/split.c
@@ -21,7 +21,6 @@
* support --suppress-matched as in csplit. */
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <getopt.h>
#include <signal.h>
diff --git a/src/system.h b/src/system.h
index e77a8fe9f..f6d67450d 100644
--- a/src/system.h
+++ b/src/system.h
@@ -20,6 +20,8 @@
#include <alloca.h>
+#include <ctype.h>
+
#include <sys/stat.h>
/* Commonly used file permission combination. */
@@ -568,8 +570,7 @@ oputs_ (MAYBE_UNUSED char const* program, char const *option)
/* Set desc_text to spacing after the full option text */
char const *desc_text = option_text + anchor_len;
- while (*desc_text && (! (*desc_text == ' ' || *desc_text == '\n')
- || *(desc_text + 1) == '-'))
+ while (*desc_text && (! isspace (*desc_text) || *(desc_text + 1) == '-'))
desc_text++;
/* write spaces before option text. */
diff --git a/src/test.c b/src/test.c
index 9e791c905..c540c62fa 100644
--- a/src/test.c
+++ b/src/test.c
@@ -21,7 +21,6 @@
the shell builtin version. */
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/tr.c b/src/tr.c
index 139cf971c..72ffffc77 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -18,7 +18,6 @@
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
#include <getopt.h>
diff --git a/src/truncate.c b/src/truncate.c
index 50e6f70b1..43134c921 100644
--- a/src/truncate.c
+++ b/src/truncate.c
@@ -21,7 +21,6 @@
to better fit the "GNU" environment. */
#include <config.h> /* sets _FILE_OFFSET_BITS=64 etc. */
-#include <ctype.h>
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/unexpand.c b/src/unexpand.c
index ec6b222ba..d7954bbb6 100644
--- a/src/unexpand.c
+++ b/src/unexpand.c
@@ -35,7 +35,6 @@
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/wc.c b/src/wc.c
index 88a386a0c..a1c7ca872 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -19,7 +19,6 @@
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>