tar: parse in a more locale-independent way.

Use g_ascii_isspace() rather than isspace().

Sync with GNU tar 01f986b921d988ae51de6c937cc374b50a8b23b0.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2023-09-17 20:13:40 +03:00
parent 16d9f23161
commit 1cada10e14

View File

@ -32,7 +32,6 @@
#include <config.h>
#include <ctype.h> /* isspace() */
#include <inttypes.h> /* uintmax_t */
#include <stdint.h> /* UINTMAX_MAX, etc */
@ -270,7 +269,7 @@ tar_from_header (const char *where0, size_t digs, char const *type, intmax_t min
if (where == lim)
return (-1);
if (!isspace ((unsigned char) *where))
if (!g_ascii_isspace (*where))
break;
where++;
@ -381,7 +380,7 @@ tar_from_header (const char *where0, size_t digs, char const *type, intmax_t min
value = -value;
}
if (where != lim && *where != '\0' && !isspace ((unsigned char) *where))
if (where != lim && *where != '\0' && !g_ascii_isspace (*where))
return (-1);
if (value <= (negative ? minus_minval : maxval))