From 8d60cd8ad69a0c0cd0dcd86e774157bddb41cb79 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 28 Oct 2023 09:22:09 -0700 Subject: [PATCH 06/11] 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. --- src/dircolors.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dircolors.c b/src/dircolors.c index f9001de07..75ea51603 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; -- 2.39.2