ash: Set SHLVL in ASH_BASH_COMPAT

function                                             old     new   delta
ash_main                                            1456    1505     +49
.rodata                                           148488  148494      +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 55/0)               Total: 55 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
This commit is contained in:
Bernhard Reutner-Fischer 2013-11-08 14:25:24 +01:00
parent 200c1c46f4
commit 80f8cdf04a

View File

@ -13012,7 +13012,10 @@ init(void)
}
setvar2("PPID", utoa(getppid()));
#if ENABLE_ASH_BASH_COMPAT
p = lookupvar("SHLVL");
setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1));
#endif
p = lookupvar("PWD");
if (p) {
if (*p != '/' || stat(p, &st1) || stat(".", &st2)