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;
}
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;
(NewToken->Params[0]->Start[0] == 'X'))
break;
LogTemplateError(
- NULL, "Conditional", ERR_NAME, &TP,
+ NULL, "Conditional", ERR_PARM1, &TP,
"Not found!");
/*
NewToken->Error = NewStrBuf();
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))
case DT_DIR:
/* Skip directories we are not interested in... */
if (strcmp(filedir_entry->d_name, ".svn") == 0)
- break;
+ continue;
FlushStrBuf(SubKey);
if (!Toplevel) {
d_without_ext --;
if ((d_without_ext == 0) || (d_namelen < 3))
continue;
- if ((d_namelen > 1) && filedir_entry->d_name[d_namelen - 1] == '~')
+ if (((d_namelen > 1) && filedir_entry->d_name[d_namelen - 1] == '~') ||
+ (strcmp(&filedir_entry->d_name[d_without_ext], ".orig") == 0) ||
+ (strcmp(&filedir_entry->d_name[d_without_ext], ".swp") == 0))
continue; /* Ignore backup files... */
/* .m.xxx is for mobile useragents! */
if (d_without_ext > 2)
}
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);
TP = &LocalTP;
}
- if (WC->is_mobile) {
+ if (WC->is_mobile > 0) {
Static = WirelessTemplateCache;
StaticLocal = WirelessLocalTemplateCache;
}
TP->Tokens = Token;
if (!GetHash(Iterators, TKEY(0), &vIt)) {
LogTemplateError(
- NULL, "Iterator", ERR_NAME, TP,
+ NULL, "Iterator", ERR_PARM1, TP,
"not found");
return 0;
}