diff options
-rw-r--r-- | shell/ash.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index f9b4d3fe6..71ef9a690 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -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) |