]> code.citadel.org Git - citadel.git/blobdiff - webcit/subst.c
* hm, something is going wrong here. allocing bigger spaces here for filenames fixes...
[citadel.git] / webcit / subst.c
index 31be4b4a8a016399b0b8da15ee98caf110367ce4..ca2a6975bf4a1f14c0fac585ddb2e1534a5a43c6 100644 (file)
@@ -1420,7 +1420,7 @@ WCTemplateToken *NewTemplateSubstitute(StrBuf *Buf,
        case SV_NEG_CONDITIONAL:
                if (NewToken->nParameters <2) {
                        LogTemplateError(
-                               NULL, "Conditional", ERR_NAME, &TP,
+                               NULL, "Conditional", ERR_PARM1, &TP,
                                "require at least 2 parameters, you gave %d params", 
                                NewToken->nParameters);
                        NewToken->Flags = 0;
@@ -1428,7 +1428,7 @@ WCTemplateToken *NewTemplateSubstitute(StrBuf *Buf,
                }
                if (NewToken->Params[1]->lvalue == 0) {
                        LogTemplateError(
-                               NULL, "Conditional", ERR_NAME, &TP,
+                               NULL, "Conditional", ERR_PARM1, &TP,
                                "Conditional ID (Parameter 1) mustn't be 0!");
                        NewToken->Flags = 0;
                        break;
@@ -1442,7 +1442,7 @@ WCTemplateToken *NewTemplateSubstitute(StrBuf *Buf,
                            (NewToken->Params[0]->Start[0] == 'X'))
                                break;
                        LogTemplateError(
-                               NULL, "Conditional", ERR_NAME, &TP,
+                               NULL, "Conditional", ERR_PARM1, &TP,
                                "Not found!");
 /*
                        NewToken->Error = NewStrBuf();
@@ -1626,7 +1626,7 @@ int LoadTemplateDir(const StrBuf *DirName, HashList *wireless, HashList *big, co
        Toplevel = StrLength(BaseKey) == 0;
        SubDirectory = NewStrBuf();
        SubKey = NewStrBuf();
-       FileName = NewStrBuf();
+       FileName = NewStrBufPlain(NULL, PATH_MAX);
        Key = NewStrBuf();
        while ((readdir_r(filedir, d, &filedir_entry) == 0) &&
               (filedir_entry != NULL))
@@ -1724,7 +1724,7 @@ int LoadTemplateDir(const StrBuf *DirName, HashList *wireless, HashList *big, co
                        }
                        StrBufAppendBufPlain(Key, filedir_entry->d_name, MinorPtr - filedir_entry->d_name, 0);
 
-                       if (LoadTemplates > 1)
+                       if (LoadTemplates >= 1)
                                lprintf(1, "%s %d %s\n", ChrPtr(FileName), IsMobile, ChrPtr(Key));
                        if (LoadTemplates == 0)
                                load_template(FileName, Key, (IsMobile)?wireless:big);
@@ -2054,7 +2054,7 @@ int preeval_iterate(WCTemplateToken *Token)
        TP->Tokens = Token;
        if (!GetHash(Iterators, TKEY(0), &vIt)) {
                LogTemplateError(
-                       NULL, "Iterator", ERR_NAME, TP,
+                       NULL, "Iterator", ERR_PARM1, TP,
                        "not found");
                return 0;
        }