From 516f42ab4059962a441e6256d78848f981a6e136 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 15 Feb 2007 08:16:30 +0100 Subject: * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase. * src/dircolors.c: Include c-strcase.h. (dc_parse_stream): Use c_strcasecmp rather than strcasecmp to avoid unreliable results in locales like Turkish where strcasecmp is incompatible with the C locale. --- src/dircolors.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/dircolors.c') diff --git a/src/dircolors.c b/src/dircolors.c index a6c98893a..82eb1e088 100644 --- a/src/dircolors.c +++ b/src/dircolors.c @@ -24,6 +24,7 @@ #include "system.h" #include "dircolors.h" +#include "c-strcase.h" #include "error.h" #include "getline.h" #include "obstack.h" @@ -295,7 +296,7 @@ dc_parse_stream (FILE *fp, const char *filename) } unrecognized = false; - if (strcasecmp (keywd, "TERM") == 0) + if (c_strcasecmp (keywd, "TERM") == 0) { if (STREQ (arg, term)) state = ST_TERMSURE; @@ -324,9 +325,9 @@ dc_parse_stream (FILE *fp, const char *filename) append_quoted (arg); APPEND_CHAR (':'); } - else if (strcasecmp (keywd, "OPTIONS") == 0 - || strcasecmp (keywd, "COLOR") == 0 - || strcasecmp (keywd, "EIGHTBIT") == 0) + else if (c_strcasecmp (keywd, "OPTIONS") == 0 + || c_strcasecmp (keywd, "COLOR") == 0 + || c_strcasecmp (keywd, "EIGHTBIT") == 0) { /* Ignore. */ } @@ -335,7 +336,7 @@ dc_parse_stream (FILE *fp, const char *filename) int i; for (i = 0; slack_codes[i] != NULL; ++i) - if (strcasecmp (keywd, slack_codes[i]) == 0) + if (c_strcasecmp (keywd, slack_codes[i]) == 0) break; if (slack_codes[i] != NULL) -- cgit v1.2.3-54-g00ecf