diff options
Diffstat (limited to 'editors/awk.c')
-rw-r--r-- | editors/awk.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c index 3adbca7..f7b8ef0 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"); |