← Commit list

46e92e1e5

Denys Vlasenko
Denys Vlasenko
2023-04-03
SUCCESS Duration: 156s

Subject

ash: code shrink: do not take address of prefix(), allowing it to inline

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 -8
@@ -3962,7 +3962,6 @@ getjob(const char *name, int getctl)
unsigned num;
int c;
const char *p;
- char *(*match)(const char *, const char *);
jp = curjob;
p = name;
@@ -4003,15 +4002,12 @@ getjob(const char *name, int getctl)
}
}
- match = prefix;
- if (*p == '?') {
- match = strstr;
- p++;
- }
-
found = NULL;
while (jp) {
- if (match(jp->ps[0].ps_cmd, p)) {
+ if (*p == '?'
+ ? strstr(jp->ps[0].ps_cmd, p + 1)
+ : prefix(jp->ps[0].ps_cmd, p)
+ ) {
if (found)
goto err;
found = jp;