From 8c09ccf3ecc24d6facc50ab0856ef17a4c7823e5 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 2 Jan 2014 15:55:38 +0000 Subject: Initialise SHLVL when shell is first started --- shell/ash.c | 4 ++++ 1 file changed, 4 insertions(+) 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) pw = xgetpwuid(getuid()); setup_environment(pw->pw_shell, SETUP_ENV_CHANGEENV|SETUP_ENV_NO_CHDIR, pw); + +#if ENABLE_ASH_BASH_COMPAT + setvareq("SHLVL=0", VEXPORT|VTEXTFIXED); +#endif } #endif for (envp = environ; envp && *envp; envp++) { -- cgit v1.2.3-55-g6feb