← Commit list

33f7c8f20

Denys Vlasenko
Denys Vlasenko
2018-03-06
SUCCESS Duration: 141s

Subject

hush: code shrink

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 -6
@@ -7181,21 +7181,22 @@ static const struct built_in_command *find_builtin(const char *name)
#if ENABLE_HUSH_FUNCTIONS
static struct function **find_function_slot(const char *name)
{
+ struct function *funcp;
struct function **funcpp = &G.top_func;
- while (*funcpp) {
- if (strcmp(name, (*funcpp)->name) == 0) {
+
+ while ((funcp = *funcpp) != NULL) {
+ if (strcmp(name, funcp->name) == 0) {
+ debug_printf_exec("found function '%s'\n", name);
break;
}
- funcpp = &(*funcpp)->next;
+ funcpp = &funcp->next;
}
return funcpp;
}
-static const struct function *find_function(const char *name)
+static ALWAYS_INLINE const struct function *find_function(const char *name)
{
const struct function *funcp = *find_function_slot(name);
- if (funcp)
- debug_printf_exec("found function '%s'\n", name);
return funcp;
}