Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 946ba29

Browse files
kbleeskasal
authored andcommitted
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 <[email protected]>
1 parent 10e1987 commit 946ba29

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compat/mingw.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,8 +1218,7 @@ static int lookup_env(char **env, const char *name, size_t nmln)
12181218
int i;
12191219

12201220
for (i = 0; env[i]; i++) {
1221-
if (0 == strncmp(env[i], name, nmln)
1222-
&& '=' == env[i][nmln])
1221+
if (!strncasecmp(env[i], name, nmln) && '=' == env[i][nmln])
12231222
/* matches */
12241223
return i;
12251224
}

0 commit comments

Comments
 (0)