From f0db8344161bfdca13aa50433a4346af3dc5a95d Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Tue, 23 Nov 2021 15:46:01 -0500 Subject: [PATCH] if we allow %() and %{}, then parse both --- src/lib/server/tmpl_tokenize.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 0ce48970262..004c5863651 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -4500,11 +4500,15 @@ ssize_t tmpl_preparse(char const **out, size_t *outlen, char const *in, size_t i * expansion, including the enclosing %{} * characters. */ - if (*p == close) { + if ((*p == '}') || (*p == ')')) { + bool match = (*p == close); + p++; depth--; if (depth == 0) { + if (!match) break; + *outlen = p - (*out); return p - in; } -- 2.47.3