mirror of
https://github.com/git/git.git
synced 2026-02-07 08:15:23 +00:00
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 <blees@dcon.de>
This commit is contained in:
committed by
Johannes Schindelin
parent
cc014c339c
commit
a34d9c21be
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user