From 1598983613cc27cab89d9036062ce6d17eb286d5 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sun, 4 Nov 2012 14:23:47 +0100 Subject: [PATCH] SUBST: fix double linked list handling for contexts. --- webcit/subst.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; -- 2.30.2