← Commit list

46a147710

Denys Vlasenko
Denys Vlasenko
2009-12-10
FAILED Duration: 27s

Subject

ash: trivial optimization -6 bytes

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+5 -3
@@ -4213,15 +4213,16 @@ cmdputs(const char *s)
};
const char *p, *str;
- char cc[2] = " ";
+ char cc[2];
char *nextc;
unsigned char c;
unsigned char subtype = 0;
int quoted = 0;
+ cc[1] = '\0';
nextc = makestrspace((strlen(s) + 1) * 8, cmdnextc);
p = s;
- while ((c = *p++) != 0) {
+ while ((c = *p++) != '\0') {
str = NULL;
switch (c) {
case CTLESC:
@@ -4292,7 +4293,8 @@ cmdputs(const char *s)
while ((c = *str++) != '\0') {
USTPUTC(c, nextc);
}
- }
+ } /* while *p++ not NUL */
+
if (quoted & 1) {
USTPUTC('"', nextc);
}