Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
ash: Set SHLVL in ASH_BASH_COMPAT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aldot committed Nov 8, 2013
1 parent 200c1c4 commit 80f8cdf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shell/ash.c
Expand Up @@ -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)
Expand Down

0 comments on commit 80f8cdf

Please sign in to comment.