From 342f35e6c8ad13dad931af7858f64c8a7f63d08f Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 18 May 2022 09:14:24 +0100 Subject: ash: restore special variables when replaced by local Commit 3194a475d (ash: export certain variables to the environment immediately) caused the special variables BB_OVERRIDE_APPLETS, BB_SKIP_ANSI_EMULATION and BB_SYSTEMROOT to be exported to the environment. If one of these variables is replaced by a local variable its previous value should be re-exported on leaving the local context (function or simple command). (GitHub issue #256) --- shell/ash.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index b3d8feb0b..ab2b0628f 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -10735,6 +10735,10 @@ poplocalvars(int keep) free((char*)vp->var_text); vp->flags = lvp->flags; vp->var_text = lvp->text; +#if ENABLE_PLATFORM_MINGW32 + if (is_bb_var(lvp->text) == BB_VAR_ASSIGN) + putenv(lvp->text); +#endif } free(lvp); } -- cgit v1.2.3-55-g6feb