From: Wilfried Goesgens Date: Sat, 27 Oct 2012 18:34:05 +0000 (+0200) Subject: SUBST: free the sub-context also if we have a negative conditional. X-Git-Tag: v8.20~205 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=99ebb68c4b810cee74bcd429cca35a74aa1b384c SUBST: free the sub-context also if we have a negative conditional. --- 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); + } } } }