From 99ebb68c4b810cee74bcd429cca35a74aa1b384c Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sat, 27 Oct 2012 20:34:05 +0200 Subject: [PATCH] SUBST: free the sub-context also if we have a negative conditional. --- webcit/subst.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webcit/subst.c b/webcit/subst.c index 95e7d47a9..6f85d04cd 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -1851,7 +1851,7 @@ const StrBuf *ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target, WCTemplputParams else if (TokenRc < 0) { if ((TPtr != &TP) && - (TPtr->ExitCTXID == TokenRc)) + (TPtr->ExitCTXID == -TokenRc)) { UnStackDynamicContext(Target, &TPtr); } @@ -1872,10 +1872,15 @@ const StrBuf *ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target, WCTemplputParams pTmpl->Tokens[i]->Flags, TokenRc, &TPtr); - if (rc == -TokenRc) + if (-rc == TokenRc) { TokenRc = 0; state = eNext; + if ((TPtr != &TP) && + (TPtr->ExitCTXID == - rc)) + { + UnStackDynamicContext(Target, &TPtr); + } } } } -- 2.30.2