aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 5c4a3073a..41bf45734 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -15801,6 +15801,23 @@ static void setvar_if_unset(const char *key, const char *value)
15801} 15801}
15802#endif 15802#endif
15803 15803
15804#if ENABLE_PLATFORM_MINGW32
15805static int mixed_case_special_name(const char *envp)
15806{
15807 const char *names = "PATH=\0""COMSPEC=\0";
15808 const char *n;
15809
15810 for (n = names; *n; ) {
15811 if (is_prefixed_with_case(envp, n) && !is_prefixed_with(envp, n)) {
15812 return TRUE;
15813 }
15814 while (*n++)
15815 ;
15816 }
15817 return FALSE;
15818}
15819#endif
15820
15804/* Don't inline: conserve stack of caller from having our locals too */ 15821/* Don't inline: conserve stack of caller from having our locals too */
15805static NOINLINE void 15822static NOINLINE void
15806init(void) 15823init(void)
@@ -15834,8 +15851,7 @@ init(void)
15834 * because it appears first. 15851 * because it appears first.
15835 */ 15852 */
15836 for (envp = environ; envp && *envp; envp++) { 15853 for (envp = environ; envp && *envp; envp++) {
15837 if (is_prefixed_with_case(*envp, "PATH=") && 15854 if (mixed_case_special_name(*envp)) {
15838 !is_prefixed_with(*envp, "PATH=")) {
15839 break; 15855 break;
15840 } 15856 }
15841 } 15857 }