← Commit list

a33d19eba

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

Subject

ash: code shrink - reuse is_prefixed_with() from libbb

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 -2
@@ -1852,16 +1852,18 @@ _STPUTC(int c, char *p)
/*
* prefix -- see if pfx is a prefix of string.
*/
-static char *
+static ALWAYS_INLINE char *
prefix(const char *string, const char *pfx)
{
+ return is_prefixed_with(string, pfx);
+#if 0 /* dash implementation: */
while (*pfx) {
if (*pfx++ != *string++)
return NULL;
}
return (char *) string;
+#endif
}
-
/*
* Check for a valid number. This should be elsewhere.
*/