summaryrefslogtreecommitdiff
path: root/src/dircolors.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2007-02-15 08:16:30 +0100
committerJim Meyering <jim@meyering.net>2007-02-15 08:16:30 +0100
commit516f42ab4059962a441e6256d78848f981a6e136 (patch)
tree654c9c377c23a748eb3aec79a52e162f54dae582 /src/dircolors.c
parentd163cd681a5a2796f47c79faccd00d193b50dc09 (diff)
downloadcoreutils-516f42ab4059962a441e6256d78848f981a6e136.tar.xz
* 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.
Diffstat (limited to 'src/dircolors.c')
-rw-r--r--src/dircolors.c11
1 files changed, 6 insertions, 5 deletions
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)