case SV_CUST_STR_CONDITIONAL:
case SV_CONDITIONAL:
case SV_NEG_CONDITIONAL:
- if (NewToken->Params[1]->lvalue == 0) {
+ if (NewToken->nParameters <2) {
lprintf(1, "Conditional (in '%s' line %ld); "
- "Conditional ID mustn't be 0! [%s]\n",
+ "require at least 2 parameters, you gave %ld params [%s]\n",
ChrPtr(pTmpl->FileName),
NewToken->Line,
+ NewToken->nParameters,
ChrPtr(NewToken->FlatToken));
NewToken->Flags = 0;
break;
}
- if (NewToken->nParameters <2) {
+ if (NewToken->Params[1]->lvalue == 0) {
lprintf(1, "Conditional (in '%s' line %ld); "
- "require at least 2 parameters, you gave %ld params [%s]\n",
+ "Conditional ID mustn't be 0! [%s]\n",
ChrPtr(pTmpl->FileName),
NewToken->Line,
- NewToken->nParameters,
ChrPtr(NewToken->FlatToken));
NewToken->Flags = 0;
break;
pts = pch;
/** Found one? parse it. */
- for (; pch < pE - 1; pch ++) {
+ for (; pch <= pE - 1; pch ++) {
if (*pch == '"')
InDoubleQuotes = ! InDoubleQuotes;
else if (*pch == '\'')
break;
}
}
- if (pch + 1 >= pE)
+ if (pch + 1 > pE)
continue;
pte = pch;
PutNewToken(NewTemplate,
SortHash = NewHash(1, NULL);
LoadZoneFiles();
+ StrBuf *foo=NewStrBufPlain("", -1);
+ StrBuf *bar = NewStrBufPlain("A", -1);
+
+ StrBufExtract_token(bar, foo, 0, '|');
+ StrBufExtract_token(bar, foo, 1, '|');
+ StrBufExtract_token(bar, foo, 2, '|');
+ StrBufExtract_token(bar, foo, 3, '|');
+ StrBufExtract_token(bar, foo, 4, '|');
+ StrBufExtract_token(bar, foo, 5, '|');
+ StrBufExtract_token(bar, foo, 6, '|');
#ifdef DBG_PRINNT_HOOKS_AT_START
dbg_PrintHash(HandlerHash, nix, NULL);