aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 9ef8f7742..b894a2314 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -10948,6 +10948,9 @@ poplocalvars(int keep)
10948 struct localvar_list *ll; 10948 struct localvar_list *ll;
10949 struct localvar *lvp, *next; 10949 struct localvar *lvp, *next;
10950 struct var *vp; 10950 struct var *vp;
10951#if ENABLE_PLATFORM_MINGW32
10952 int var_type;
10953#endif
10951 10954
10952 INT_OFF; 10955 INT_OFF;
10953 ll = localvar_stack; 10956 ll = localvar_stack;
@@ -10991,8 +10994,15 @@ poplocalvars(int keep)
10991 vp->flags = lvp->flags; 10994 vp->flags = lvp->flags;
10992 vp->var_text = lvp->text; 10995 vp->var_text = lvp->text;
10993#if ENABLE_PLATFORM_MINGW32 10996#if ENABLE_PLATFORM_MINGW32
10994 if (is_bb_var(lvp->text) == BB_VAR_ASSIGN) 10997 var_type = is_bb_var(lvp->text);
10998 if (var_type == BB_VAR_ASSIGN && (lvp->flags & VEXPORT))
10995 putenv(lvp->text); 10999 putenv(lvp->text);
11000 else if (var_type) {
11001 char *var = xstrdup(lvp->text);
11002 *strchrnul(var, '=') = '\0';
11003 unsetenv(var);
11004 free(var);
11005 }
10996#endif 11006#endif
10997 } 11007 }
10998 free(lvp); 11008 free(lvp);