mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03: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:
1 parent
a3ce33c106
commit
2709bea0f4
1 file changed
+2
-2
+2
-2
@@ -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