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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user