From 1cada10e146ea8c71955b45697ab5afe47e434f7 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 17 Sep 2023 20:13:40 +0300 Subject: [PATCH] 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 --- src/vfs/tar/tar-internal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vfs/tar/tar-internal.c b/src/vfs/tar/tar-internal.c index 63fd4398e..b0bb04adf 100644 --- a/src/vfs/tar/tar-internal.c +++ b/src/vfs/tar/tar-internal.c @@ -32,7 +32,6 @@ #include -#include /* isspace() */ #include /* uintmax_t */ #include /* 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))