← Commit list

e60c56932

Denys Vlasenko
Denys Vlasenko
2021-09-09
SUCCESS Duration: 153s

Subject

awk: 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 →

editors/awk.c+7 -8
@@ -2351,16 +2351,15 @@ static char *awk_printf(node *n, size_t *len)
c = *f;
if (!c) /* no percent chars found at all */
goto nul;
- if (c == '%') {
- c = *++f;
- if (!c) /* we are past % in "....%" */
- goto nul;
- break;
- }
f++;
+ if (c == '%')
+ break;
}
- /* we are past % in "....%...", c == char after % */
- if (c == '%') { /* double % */
+ /* we are past % in "....%..." */
+ c = *f;
+ if (!c) /* "....%" */
+ goto nul;
+ if (c == '%') { /* "....%%...." */
slen = f - s;
s = xstrndup(s, slen);
f++;