]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
test: allow non-blank white space in numbers
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 28 Oct 2023 23:15:49 +0000 (16:15 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Oct 2023 07:58:04 +0000 (00:58 -0700)
* src/test.c (find_int): Use isspace, not isblank,
for compatibility with how strtol works, which
is how most other shells do this.

src/test.c

index 2bcb9abc8c6f02fbf0ec83a67e50a65661bab760..4f14e40800d3a0f0b8d5e205200af5374820ef04 100644 (file)
@@ -136,7 +136,7 @@ find_int (char const *string)
   char const *p;
   char const *number_start;
 
-  for (p = string; isblank (to_uchar (*p)); p++)
+  for (p = string; isspace (to_uchar (*p)); p++)
     continue;
 
   if (*p == '+')
@@ -154,7 +154,7 @@ find_int (char const *string)
     {
       while (ISDIGIT (*p))
         p++;
-      while (isblank (to_uchar (*p)))
+      while (isspace (to_uchar (*p)))
         p++;
       if (!*p)
         return number_start;