From c9d94984588d166bcdc077a7972a1b454678ba10 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 9 Nov 2009 22:33:54 +0100 Subject: [PATCH] change strncasecmp() == 0 to STRCASEEQLEN() git grep -l 'strncasecmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrncasecmp( *\(.*?\)) *== *0\b/STRCASEEQLEN$1/g' --- fish/destpaths.c | 2 +- fish/fish.c | 2 +- src/generator.ml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fish/destpaths.c b/fish/destpaths.c index 87287aa..c12c64a 100644 --- a/fish/destpaths.c +++ b/fish/destpaths.c @@ -215,7 +215,7 @@ complete_dest_paths_generator (const char *text, int state) word = &words[index]; index++; - if (strncasecmp (word->name, text, len) == 0) { + if (STRCASEEQLEN (word->name, text, len)) { if (word->is_dir) rl_completion_append_character = '/'; diff --git a/fish/fish.c b/fish/fish.c index 0387eb7..3f534de 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1350,7 +1350,7 @@ resolve_win_path (const char *path) path += 4; /* Drop drive letter, if it's "C:". */ - if (strncasecmp (path, "c:", 2) == 0) + if (STRCASEEQLEN (path, "c:", 2)) path += 2; if (!*path) { diff --git a/src/generator.ml b/src/generator.ml index 3c1ff2b..4fba15f 100644 --- a/src/generator.ml +++ b/src/generator.ml @@ -6772,7 +6772,7 @@ generator (const char *text, int state) while ((name = commands[index]) != NULL) { index++; - if (strncasecmp (name, text, len) == 0) + if (STRCASEEQLEN (name, text, len)) return strdup (name); } -- 1.8.3.1