diff options
author | Ron Yorston <rmy@pobox.com> | 2014-01-02 15:55:38 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-01-02 15:55:38 +0000 |
commit | 8c09ccf3ecc24d6facc50ab0856ef17a4c7823e5 (patch) | |
tree | ad3d995f1a135c8606ac6e8f7634b0a640f6c4ad | |
parent | f1455f148d8ad298ee274bc69b17fcfacd14cab4 (diff) | |
download | busybox-w32-8c09ccf3ecc24d6facc50ab0856ef17a4c7823e5.tar.gz busybox-w32-8c09ccf3ecc24d6facc50ab0856ef17a4c7823e5.tar.bz2 busybox-w32-8c09ccf3ecc24d6facc50ab0856ef17a4c7823e5.zip |
Initialise SHLVL when shell is first started
-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 97c9589cc..e885e2ce5 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -13605,6 +13605,10 @@ init(void) | |||
13605 | pw = xgetpwuid(getuid()); | 13605 | pw = xgetpwuid(getuid()); |
13606 | setup_environment(pw->pw_shell, | 13606 | setup_environment(pw->pw_shell, |
13607 | SETUP_ENV_CHANGEENV|SETUP_ENV_NO_CHDIR, pw); | 13607 | SETUP_ENV_CHANGEENV|SETUP_ENV_NO_CHDIR, pw); |
13608 | |||
13609 | #if ENABLE_ASH_BASH_COMPAT | ||
13610 | setvareq("SHLVL=0", VEXPORT|VTEXTFIXED); | ||
13611 | #endif | ||
13608 | } | 13612 | } |
13609 | #endif | 13613 | #endif |
13610 | for (envp = environ; envp && *envp; envp++) { | 13614 | for (envp = environ; envp && *envp; envp++) { |