Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-09-09 20:13:32 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2021-09-30 01:15:44 +0300
commit118baea06ee83ad2f47f801e82304b442aab71f0 (patch)
tree46b3ab602fcbd96acd93a7cce045c5a7bc05e26d
parent5ec12fa657052ceebe02f98571402232ca411c3c (diff)
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)
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++;