aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2022-05-18 09:14:24 +0100
committerRon Yorston <rmy@pobox.com>2022-05-18 09:14:24 +0100
commit342f35e6c8ad13dad931af7858f64c8a7f63d08f (patch)
tree5d19e42c71e79fb4fe24faf9454d919804719a72
parent6c0d3596823ab0c24389348bbad9f28cfc793865 (diff)
downloadbusybox-w32-342f35e6c8ad13dad931af7858f64c8a7f63d08f.tar.gz
busybox-w32-342f35e6c8ad13dad931af7858f64c8a7f63d08f.tar.bz2
busybox-w32-342f35e6c8ad13dad931af7858f64c8a7f63d08f.zip
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)
-rw-r--r--shell/ash.c4
1 files changed, 4 insertions, 0 deletions
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)
10735 free((char*)vp->var_text); 10735 free((char*)vp->var_text);
10736 vp->flags = lvp->flags; 10736 vp->flags = lvp->flags;
10737 vp->var_text = lvp->text; 10737 vp->var_text = lvp->text;
10738#if ENABLE_PLATFORM_MINGW32
10739 if (is_bb_var(lvp->text) == BB_VAR_ASSIGN)
10740 putenv(lvp->text);
10741#endif
10738 } 10742 }
10739 free(lvp); 10743 free(lvp);
10740 } 10744 }