author | Johannes Sixt <j6t@kdbg.org> | |
Mon, 6 Jun 2011 07:08:13 +0000 (09:08 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Jun 2011 18:35:10 +0000 (11:35 -0700) | ||
commit | df599e9612788b728ce43a03159b85f1fe624d6a | |
tree | 779040c908fbf1e19318c73f19e2c69e0b8cebb9 | tree | snapshot |
parent | 06bc4b796ad69ba93f0a8c451368602e0553c2d3 | commit | diff |
Windows: teach getenv to do a case-sensitive search
getenv() on Windows looks up environment variables in a case-insensitive
manner. Even though all documentations claim that the environment is
case-insensitive, it is possible for applications to pass an environment
to child processes that has variables that differ only in case. Bash on
Windows does this, for example, and sh-i18n--envsubst depends on this
behavior.
With this patch environment variables are first looked up in a
case-sensitive manner; only if this finds nothing, the system's getenv() is
used as a fallback.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
getenv() on Windows looks up environment variables in a case-insensitive
manner. Even though all documentations claim that the environment is
case-insensitive, it is possible for applications to pass an environment
to child processes that has variables that differ only in case. Bash on
Windows does this, for example, and sh-i18n--envsubst depends on this
behavior.
With this patch environment variables are first looked up in a
case-sensitive manner; only if this finds nothing, the system's getenv() is
used as a fallback.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | diff | blob | history |