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:
Diffstat (limited to 'editors/awk.c')
-rw-r--r--editors/awk.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 3adbca7aa..f7b8ef0d3 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -2346,8 +2346,15 @@ static char *awk_printf(node *n, size_t *len)
size_t slen;
s = f;
- while (*f && (*f != '%' || *++f == '%'))
+ while (*f && *f != '%')
f++;
+ c = *++f;
+ if (c == '%') { /* double % */
+ slen = f - s;
+ s = xstrndup(s, slen);
+ f++;
+ goto tail;
+ }
while (*f && !isalpha(*f)) {
if (*f == '*')
syntax_error("%*x formats are not supported");