From a34d9c21bef5e36129fb6af37705859e2d5caa40 Mon Sep 17 00:00:00 2001 From: Karsten Blees Date: Sat, 14 Jan 2012 23:42:09 +0100 Subject: [PATCH] Win32: unify environment case-sensitivity The environment on Windows is case-insensitive. Some environment functions (such as unsetenv and make_augmented_environ) have always used case- sensitive comparisons instead, while others (getenv, putenv, sorting in spawn*) were case-insensitive. Prevent potential inconsistencies by using case-insensitive comparison in lookup_env (used by putenv, unsetenv and make_augmented_environ). Signed-off-by: Karsten Blees --- compat/mingw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index b3ff81ecc1..f3aeb0289c 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1218,8 +1218,7 @@ static int lookup_env(char **env, const char *name, size_t nmln) int i; for (i = 0; env[i]; i++) { - if (0 == strncmp(env[i], name, nmln) - && '=' == env[i][nmln]) + if (!strncasecmp(env[i], name, nmln) && '=' == env[i][nmln]) /* matches */ return i; }