aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 1f8f85639..7482ebf6f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -13215,6 +13215,33 @@ init(void)
13215 struct stat st1, st2; 13215 struct stat st1, st2;
13216 13216
13217 initvar(); 13217 initvar();
13218
13219#if ENABLE_PLATFORM_MINGW32
13220 /*
13221 * case insensitive env names from Windows world
13222 *
13223 * Some standard env names such as PATH is named Path and so on
13224 * ash itself is case sensitive, so "Path" will confuse it, as
13225 * MSVC getenv() is case insensitive.
13226 *
13227 * We may end up having both Path and PATH. Then Path will be chosen
13228 * because it appears first.
13229 */
13230 for (envp = environ; envp && *envp; envp++)
13231 if (!strncasecmp(*envp, "PATH=", 5) &&
13232 strncmp(*envp, "PATH=", 5))
13233 break;
13234 if (envp && *envp) {
13235 char *start, *end;
13236 for (envp = environ; envp && *envp; envp++) {
13237 end = strchr(*envp, '=');
13238 if (!end)
13239 continue;
13240 for (start = *envp;start < end;start++)
13241 *start = toupper(*start);
13242 }
13243 }
13244#endif
13218 for (envp = environ; envp && *envp; envp++) { 13245 for (envp = environ; envp && *envp; envp++) {
13219 if (strchr(*envp, '=')) { 13246 if (strchr(*envp, '=')) {
13220 setvareq(*envp, VEXPORT|VTEXTFIXED); 13247 setvareq(*envp, VEXPORT|VTEXTFIXED);