diff options
author | Ron Yorston <rmy@pobox.com> | 2022-05-18 09:14:24 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-05-18 09:14:24 +0100 |
commit | 342f35e6c8ad13dad931af7858f64c8a7f63d08f (patch) | |
tree | 5d19e42c71e79fb4fe24faf9454d919804719a72 | |
parent | 6c0d3596823ab0c24389348bbad9f28cfc793865 (diff) | |
download | busybox-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.c | 4 |
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 | } |