← Commit list

85241c7b0

Denys Vlasenko
Denys Vlasenko
2017-07-26
SUCCESS Duration: 141s

Subject

ash: [VAR] Do not poplocalvars prematurely on regular utilities

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+6 -4
@@ -9539,7 +9539,7 @@ static const struct builtincmd builtintab[] = {
#if ENABLE_FEATURE_SH_MATH
{ BUILTIN_NOSPEC "let" , letcmd },
#endif
- { BUILTIN_ASSIGN "local" , localcmd },
+ { BUILTIN_SPEC_REG_ASSG "local" , localcmd },
#if ENABLE_ASH_PRINTF
{ BUILTIN_REGULAR "printf" , printfcmd },
#endif
@@ -9849,9 +9849,11 @@ evalcommand(union node *cmd, int flags)
/* NOTREACHED */
} /* default */
case CMDBUILTIN:
- poplocalvars(spclbltin > 0 || argc == 0);
- if (cmd_is_exec && argc > 1)
- listsetvar(varlist.list, VEXPORT);
+ if (spclbltin > 0 || argc == 0) {
+ poplocalvars(1);
+ if (cmd_is_exec && argc > 1)
+ listsetvar(varlist.list, VEXPORT);
+ }
/* Tight loop with builtins only:
* "while kill -0 $child; do true; done"