]> code.citadel.org Git - citadel.git/blobdiff - webcit/subst.c
check whether the sorting algorithm specified via BSTRs is intended for us before...
[citadel.git] / webcit / subst.c
index 4e08db7ace058e6464fdd11db346d417f143a139..bc6c747fab82040f1eb4895f3f86417d22324882 100644 (file)
@@ -110,6 +110,7 @@ const char *CtxNames[]  = {
        "Context ICAL",
        "Context DavNamespace",
        "Context TAB",
+       "Context VCARD",
        "Context UNKNOWN"
 };
 
@@ -881,6 +882,8 @@ int GetNextParameter(StrBuf *Buf,
                                        }
                                }
                        }
+                       FreeStrBuf(&pToken);
+                       FreeStrBuf(&Match);
                }
                else if (strchr(Parm->Start, '&') != NULL)
                {
@@ -917,6 +920,8 @@ int GetNextParameter(StrBuf *Buf,
                                        }
                                }
                        }
+                       FreeStrBuf(&Match);
+                       FreeStrBuf(&pToken);
                }
                else {
 
@@ -1881,8 +1886,10 @@ void tmpl_iterate_subtmpl(StrBuf *Target, WCTemplputParams *TP)
                        if (GetHash(SortHash, SKEY(BSort), &vSortBy) &&
                            (vSortBy != NULL)) {
                                SortBy = (SortStruct*)vSortBy;
+                               /* first check whether its intended for us... */
+                               if ((SortBy->ContextType == It->ContextType)&&
                                /** Ok, its us, lets see in which direction we should sort... */
-                               if (havebstr("SortOrder")) {
+                                   (havebstr("SortOrder"))) {
                                        int SortOrder;
                                        SortOrder = LBSTR("SortOrder");
                                        if (SortOrder != 0)