From: Paul Eggert Date: Sat, 28 Oct 2023 16:22:09 +0000 (-0700) Subject: dircolors: assume C-locale spaces X-Git-Tag: v9.5~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d60cd8ad69a0c0cd0dcd86e774157bddb41cb79;p=thirdparty%2Fcoreutils.git dircolors: assume C-locale spaces * src/dircolors.c: Include c-ctype.h, not ctype.h. (parse_line): Use c_isspace, not isspace, as the .dircolors file format (which does not seem to be documented!) appears to be ASCII. --- diff --git a/src/dircolors.c b/src/dircolors.c index f9001de077..75ea516037 100644 --- a/src/dircolors.c +++ b/src/dircolors.c @@ -17,13 +17,13 @@ #include -#include #include #include #include #include "system.h" #include "dircolors.h" +#include "c-ctype.h" #include "c-strcase.h" #include "obstack.h" #include "quote.h" @@ -153,7 +153,7 @@ parse_line (char const *line, char **keyword, char **arg) *keyword = nullptr; *arg = nullptr; - for (p = line; isspace (to_uchar (*p)); ++p) + for (p = line; c_isspace (to_uchar (*p)); ++p) continue; /* Ignore blank lines and shell-style comments. */ @@ -162,7 +162,7 @@ parse_line (char const *line, char **keyword, char **arg) keyword_start = p; - while (!isspace (to_uchar (*p)) && *p != '\0') + while (!c_isspace (to_uchar (*p)) && *p != '\0') { ++p; } @@ -175,7 +175,7 @@ parse_line (char const *line, char **keyword, char **arg) { ++p; } - while (isspace (to_uchar (*p))); + while (c_isspace (to_uchar (*p))); if (*p == '\0' || *p == '#') return; @@ -185,7 +185,7 @@ parse_line (char const *line, char **keyword, char **arg) while (*p != '\0' && *p != '#') ++p; - for (--p; isspace (to_uchar (*p)); --p) + for (--p; c_isspace (to_uchar (*p)); --p) continue; ++p;