]> code.citadel.org Git - citadel.git/blobdiff - webcit/subst.c
* fix another off by one while retrieving the iterator counter params
[citadel.git] / webcit / subst.c
index f4fde0edb9787d7c2e8c1d3d1bbc5aeb40ddb043..faf685dbdb84c055e72efda141191ecff4947c03 100644 (file)
@@ -1830,14 +1830,14 @@ void tmpl_iterate_subtmpl(StrBuf *Target, WCTemplputParams *TP)
        SubTP.Filter.ControlContextType = CTX_ITERATE;
        SubTP.ControlContext = &Status;
        
+       if (HAVE_PARAM(2)) {
+               StartAt = GetTemplateTokenNumber(Target, TP, 2, 0);
+       }
        if (HAVE_PARAM(3)) {
-               StartAt = GetTemplateTokenNumber(Target, TP, 3, 0);
+               StepWidth = GetTemplateTokenNumber(Target, TP, 3, 0);
        }
        if (HAVE_PARAM(4)) {
-               StepWidth = GetTemplateTokenNumber(Target, TP, 4, 0);
-       }
-       if (HAVE_PARAM(5)) {
-               StopAt = GetTemplateTokenNumber(Target, TP, 5, -1);
+               StopAt = GetTemplateTokenNumber(Target, TP, 4, -1);
        }
        it = GetNewHashPos(List, StepWidth);
        if (StopAt < 0) {