← Commit list

80f8cdf04

Bernhard Reutner-Fischer
Bernhard Reutner-Fischer
2013-11-08
SUCCESS Duration: 163s

Subject

ash: Set SHLVL in ASH_BASH_COMPAT

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash.c+4 -1
@@ -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)