diff options
-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++; |