diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2013-11-08 14:25:24 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2013-11-08 14:30:20 +0100 |
commit | 80f8cdf04ad0e8b37c20aed883b6cbfd6636dbc3 (patch) | |
tree | ec089796aedb19e53df734a277da78767a7ec70a | |
parent | 200c1c46f4aa2cb70e0e3581a5bd8aa72a1aac0f (diff) | |
download | busybox-w32-80f8cdf04ad0e8b37c20aed883b6cbfd6636dbc3.tar.gz busybox-w32-80f8cdf04ad0e8b37c20aed883b6cbfd6636dbc3.tar.bz2 busybox-w32-80f8cdf04ad0e8b37c20aed883b6cbfd6636dbc3.zip |
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>
-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) | |||
13012 | } | 13012 | } |
13013 | 13013 | ||
13014 | setvar2("PPID", utoa(getppid())); | 13014 | setvar2("PPID", utoa(getppid())); |
13015 | 13015 | #if ENABLE_ASH_BASH_COMPAT | |
13016 | p = lookupvar("SHLVL"); | ||
13017 | setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1)); | ||
13018 | #endif | ||
13016 | p = lookupvar("PWD"); | 13019 | p = lookupvar("PWD"); |
13017 | if (p) { | 13020 | if (p) { |
13018 | if (*p != '/' || stat(p, &st1) || stat(".", &st2) | 13021 | if (*p != '/' || stat(p, &st1) || stat(".", &st2) |