mirror of
https://codeberg.org/kiss-community/repo
synced 2025-01-11 13:20:08 -07:00
22 lines
514 B
Diff
22 lines
514 B
Diff
|
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");
|