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:
parent
200c1c46f4
commit
80f8cdf04a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user