From: Wilfried Goesgens Date: Sun, 4 Nov 2012 13:23:47 +0000 (+0100) Subject: SUBST: fix double linked list handling for contexts. X-Git-Tag: v8.20~194 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=1598983613cc27cab89d9036062ce6d17eb286d5 SUBST: fix double linked list handling for contexts. --- diff --git a/webcit/subst.c b/webcit/subst.c index 02de06103..c3b094874 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -163,6 +163,8 @@ void StackDynamicContext(WCTemplputParams *Super, Sub->Sub = Super->Sub; Super->Sub = Sub; } + if (Sub->Sub != NULL) + Sub->Sub->Super = Sub; Sub->Super = Super; Sub->Context = Context; @@ -179,6 +181,10 @@ void UnStackContext(WCTemplputParams *Sub) { Sub->Super->Sub = Sub->Sub; } + if (Sub->Sub != NULL) + { + Sub->Sub->Super = Sub->Super; + } } void UnStackDynamicContext(StrBuf *Target, WCTemplputParams **TPP) { @@ -315,9 +321,6 @@ void LogTemplateError (StrBuf *Target, const char *Type, int ErrorPos, WCTemplpu */ } - - - void LogError (StrBuf *Target, const char *Type, const char *Format, ...) { wcsession *WCC; @@ -2254,10 +2257,12 @@ int EvaluateConditional(StrBuf *Target, int Neg, int state, WCTemplputParams **T res = Cond->CondF(Target, TP); if (res == Neg) rc = TP->Tokens->Params[1]->lvalue; + if (LoadTemplates > 5) syslog(1, "<%s> : %d %d==%d\n", ChrPtr(TP->Tokens->FlatToken), rc, res, Neg); + if (TP->Sub != NULL) { *TPP = TP->Sub;