aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-09-09 19:13:32 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-09-30 00:15:44 +0200
commit118baea06ee83ad2f47f801e82304b442aab71f0 (patch)
tree46b3ab602fcbd96acd93a7cce045c5a7bc05e26d
parent5ec12fa657052ceebe02f98571402232ca411c3c (diff)
downloadbusybox-w32-118baea06ee83ad2f47f801e82304b442aab71f0.tar.gz
busybox-w32-118baea06ee83ad2f47f801e82304b442aab71f0.tar.bz2
busybox-w32-118baea06ee83ad2f47f801e82304b442aab71f0.zip
awk: code shrink
function old new delta awk_printf 652 651 -1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/awk.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 46bda93b2..6644d7d6f 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -2351,16 +2351,15 @@ static char *awk_printf(node *n, size_t *len)
2351 c = *f; 2351 c = *f;
2352 if (!c) /* no percent chars found at all */ 2352 if (!c) /* no percent chars found at all */
2353 goto nul; 2353 goto nul;
2354 if (c == '%') {
2355 c = *++f;
2356 if (!c) /* we are past % in "....%" */
2357 goto nul;
2358 break;
2359 }
2360 f++; 2354 f++;
2355 if (c == '%')
2356 break;
2361 } 2357 }
2362 /* we are past % in "....%...", c == char after % */ 2358 /* we are past % in "....%..." */
2363 if (c == '%') { /* double % */ 2359 c = *f;
2360 if (!c) /* "....%" */
2361 goto nul;
2362 if (c == '%') { /* "....%%...." */
2364 slen = f - s; 2363 slen = f - s;
2365 s = xstrndup(s, slen); 2364 s = xstrndup(s, slen);
2366 f++; 2365 f++;