mirror of https://github.com/mirror/busybox.git
awk: code shrink
function old new delta awk_printf 652 651 -1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>pull/49/head
parent
8a0adba9f6
commit
e60c56932e
|
@ -2351,16 +2351,15 @@ static char *awk_printf(node *n, size_t *len)
|
||||||
c = *f;
|
c = *f;
|
||||||
if (!c) /* no percent chars found at all */
|
if (!c) /* no percent chars found at all */
|
||||||
goto nul;
|
goto nul;
|
||||||
if (c == '%') {
|
|
||||||
c = *++f;
|
|
||||||
if (!c) /* we are past % in "....%" */
|
|
||||||
goto nul;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
f++;
|
f++;
|
||||||
|
if (c == '%')
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
/* we are past % in "....%...", c == char after % */
|
/* we are past % in "....%..." */
|
||||||
if (c == '%') { /* double % */
|
c = *f;
|
||||||
|
if (!c) /* "....%" */
|
||||||
|
goto nul;
|
||||||
|
if (c == '%') { /* "....%%...." */
|
||||||
slen = f - s;
|
slen = f - s;
|
||||||
s = xstrndup(s, slen);
|
s = xstrndup(s, slen);
|
||||||
f++;
|
f++;
|
||||||
|
|
Loading…
Reference in New Issue