diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-09 19:13:32 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-09 19:13:32 +0200 |
commit | e60c56932ed95eb1c72b12d7404d42798da61bca (patch) | |
tree | 4c3e71d9c2adf2ea1492436b0f70a2510236d339 | |
parent | 8a0adba9f67a661e0f2428bf43ae8da15f641ec0 (diff) | |
download | busybox-w32-e60c56932ed95eb1c72b12d7404d42798da61bca.tar.gz busybox-w32-e60c56932ed95eb1c72b12d7404d42798da61bca.tar.bz2 busybox-w32-e60c56932ed95eb1c72b12d7404d42798da61bca.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.c | 15 |
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++; |