ash: in bash compat mode, always export $SHLVL

function                                             old     new   delta
ash_main                                            1437    1442      +5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2014-01-07 16:12:48 +01:00
parent cd55f2d933
commit 5680e98451

View File

@ -13014,7 +13014,7 @@ init(void)
setvar2("PPID", utoa(getppid())); setvar2("PPID", utoa(getppid()));
#if ENABLE_ASH_BASH_COMPAT #if ENABLE_ASH_BASH_COMPAT
p = lookupvar("SHLVL"); p = lookupvar("SHLVL");
setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1)); setvar("SHLVL", utoa((p ? atoi(p) : 0) + 1), VEXPORT);
#endif #endif
p = lookupvar("PWD"); p = lookupvar("PWD");
if (p) { if (p) {