]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: parse any whitespace as an option/description delimiter
authorPádraig Brady <P@draigBrady.com>
Sun, 4 Jan 2026 15:11:57 +0000 (15:11 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 21 Jan 2026 13:51:39 +0000 (13:51 +0000)
* 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.

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

index 8db28ecf252cf1eaf3ba75e1766196725873f924..48ef38d73c7b12c48512fdfd140932a7f5a3779a 100644 (file)
@@ -17,7 +17,6 @@
 /* Written by Roland McGrath.  */
 
 #include <config.h>
-#include <ctype.h>
 #include <getopt.h>
 #include <stdio.h>
 #include <sys/types.h>
index a28f2fa5fa56abc000cadf9d8581a251c28cc48f..2fdc5e819f25cea19cfb9bb5a4f9f4f043e10165 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <config.h>
 
-#include <ctype.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <signal.h>
index acb268aa4094983f5f59e41e6bdc3e4726c36f58..ff3d42050024b9a3bbd232fbf34d8b8fb60ef533 100644 (file)
--- 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>
 
index afe613dc6b917ff3d0fdf7eb7a32d1958c6a8bac..0d4f8955a0977b4e6ae81ccbfb2852d307d4df63 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <config.h>
 
-#include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include "system.h"
index 8539da3e47f3fc01600a348f47bff515b877fe23..ef74ab0f64d632d334cacf16421d96407e2d7112 100644 (file)
@@ -34,7 +34,6 @@
 
 #include <config.h>
 
-#include <ctype.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index 72b4d0adf2de684e9dc35e32226fc95ce2aa653d..e7edb5735c2e929506ac4997fb00130d2b5a7c7e 100644 (file)
--- 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>
index 09a7f144aed5c835f24fc973c2ed8c0558eae1dd..1a6432dea7a5c3957cecc8945cf7b0e554ee2ac5 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <config.h>
 
-#include <ctype.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index 3fa04412aaa745f3b21a9a3d19fe01b5c9805a87..8d28fe0ff6430574797d5d59b1d20a6b5945b670 100644 (file)
--- 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>
index ac5cd9b7b0ab0d307a45f6a9245f3fc482fd7888..dbb0080270723fb74f60b582d38787c4083b0d2a 100644 (file)
@@ -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>
index c421bd6da6b6ec097e1043ac0431a1afddd83a07..725fa7278183b5780f51503911c145c0619333ef 100644 (file)
--- 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>
index 887b32fc4144a4f9dd93f7841c332b1640d9853d..bcc936ac8b781e2f99f1123d1b3330d815c4c461 100644 (file)
@@ -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>
index 5dfc58adba6071768352a7cc8c68eb5348ecb800..fa395dc9cdae7d91718ab85c40546a2674b6bf26 100644 (file)
--- a/src/pr.c
+++ b/src/pr.c
 
 #include <config.h>
 
-#include <ctype.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include "system.h"
index 59e8508a6b607551adcf4e73fc5940347bf00276..5b6b30cf5bc71593cc230efefd716adbd60b2379 100644 (file)
--- 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"
index f72875862851c59c41b0ef0015233752ce5fa083..2d3ff322d9881f2b3f94100a09643d825f299796 100644 (file)
--- 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>
index 523549214c50361482a9d11840857852a08fb4e7..5b3264d35fabf05a5a5c06b0bf1998c52795f5b1 100644 (file)
@@ -19,7 +19,6 @@
 #include <config.h>
 
 #include "system.h"
-#include <ctype.h>
 #include "c-ctype.h"
 #include "quote.h"
 #include "set-fields.h"
index e5f31b1799e9864c8a4b3d1e78b092c8f2f154e3..c5bf44d31cd6bfe61ad65cc2ef56c5e59bbbc88d 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include <ctype.h>
 #include <getopt.h>
 #include <pthread.h>
 #include <sys/resource.h>
index deeff03c331fcf39b59b6e8f43bb0f68735f613e..9878c09f3800ea4ec9d29990a02a8ca6f63eefc0 100644 (file)
@@ -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>
index e77a8fe9f9497dce1d5e8451a1a08f116f0221ce..f6d67450d6216146f1c812823fdd316a0c0947e2 100644 (file)
@@ -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. */
index 9e791c905506de5557fecc5a8725bdbfdb3188a8..c540c62faab7539c38b6a22e5f6cc4a0d093a4cf 100644 (file)
@@ -21,7 +21,6 @@
    the shell builtin version. */
 
 #include <config.h>
-#include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
 
index 139cf971c54d871e97c124fd6a4c26752f131b0d..72ffffc771a548fccf2126807cd9775d9ed8c8c2 100644 (file)
--- 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>
index 50e6f70b1844a3a1b7e9e37edc18900e6a6c9fb5..43134c921a529181d19269ffe31de0c40918d001 100644 (file)
@@ -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>
index ec6b222ba0a38d5f9d0d622494a419bafd162387..d7954bbb6180cb416f60aece31e22041f93b96aa 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <config.h>
 
-#include <ctype.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index 88a386a0c9b5f832bbc77ba8bb7973e434c1fbdf..a1c7ca872dad4f85d688f4cd26a228e73709a7b9 100644 (file)
--- 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>