From 1249b425b6384347c101aa16a960a60e999eaf2b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 11 Sep 2008 13:00:20 +0000 Subject: [PATCH] * warn if we don't know an iterator --- webcit/subst.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/webcit/subst.c b/webcit/subst.c index 38f1bae35..0aa6bb070 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -1010,6 +1010,8 @@ void *load_template(StrBuf *filename, StrBuf *Key, HashList *PutThere) const char *pts, *pte; int InQuotes = 0; int InDoubleQuotes = 0; + + /** Find one */ pos = (-1); for (; pch < pE; pch ++) { if ((*pch=='<')&&(*(pch + 1)=='?')) @@ -1019,6 +1021,8 @@ void *load_template(StrBuf *filename, StrBuf *Key, HashList *PutThere) if (pch >= pE) continue; pts = pch; + + /** Found one? parse it. */ for (; pch < pE - 1; pch ++) { if (*pch == '"') InDoubleQuotes = ! InDoubleQuotes; @@ -1237,8 +1241,21 @@ void tmpl_iterate_subtmpl(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, vo if (!GetHash(Iterators, Tokens->Params[0]->Start, Tokens->Params[0]->len, - &vIt)) + &vIt)) { + lprintf(1, "unknown Iterator [%s] (in line %ld); " + " [%s]\n", + Tokens->Params[0]->Start, + Tokens->Line, + ChrPtr(Tokens->FlatToken)); + StrBufAppendPrintf( + Target, + "
\nunknown Iterator [%s] (in line %ld); \n"
+			" [%s]\n
", + Tokens->Params[0]->Start, + Tokens->Line, + ChrPtr(Tokens->FlatToken)); return; + } It = (HashIterator*) vIt; -- 2.39.2