1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-17 12:52:16 +02:00

test: allow non-blank white space in numbers

* src/test.c (find_int): Use isspace, not isblank,
for compatibility with how strtol works, which
is how most other shells do this.
This commit is contained in:
Paul Eggert
2023-10-28 16:15:49 -07:00
parent a3ce33c106
commit 2709bea0f4

View 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;