← Commit list

b95ee96e7

Denys Vlasenko
Denys Vlasenko
2017-07-17
SUCCESS Duration: 143s

Subject

hush: smaller code in !READONLY configs

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/hush.c+7 -4
@@ -9347,11 +9347,14 @@ static int helper_export_local(char **argv,
}
}
# if ENABLE_HUSH_LOCAL
- if (exp == 0 && ro == 0 /* local? */
- && var && var->func_nest_level == lvl
+ /* Is this "local" bltin? */
+ if (exp == 0
+ IF_HUSH_READONLY(&& ro == 0) /* in !READONLY config, always true */
) {
- /* "local x=abc; ...; local x" - ignore second local decl */
- continue;
+ if (var && var->func_nest_level == lvl) {
+ /* "local x=abc; ...; local x" - ignore second local decl */
+ continue;
+ }
}
# endif
/* Exporting non-existing variable.