Commit 7e5b9e2f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't advance the token in vcc_UintVal(), that prevents precise

error messages based on the value of the integer.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2479 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent bfa94ee9
......@@ -75,6 +75,7 @@ vcc_acl_entry(struct tokenlist *tl)
vcc_NextToken(tl);
ExpectErr(tl, CNUM);
mask = vcc_UintVal(tl);
vcc_NextToken(tl);
}
Fh(tl, 1, "{ %u, %u, %u, ", not, mask, para);
EncToken(tl->fh, t);
......
......@@ -97,9 +97,10 @@ parse_error(struct tokenlist *tl)
unsigned a;
vcc_NextToken(tl);
if (tl->t->tok == CNUM)
if (tl->t->tok == CNUM) {
a = vcc_UintVal(tl);
else
vcc_NextToken(tl);
} else
a = 0;
Fb(tl, 1, "VRT_error(sp, %u", a);
if (tl->t->tok == CSTR) {
......@@ -182,9 +183,10 @@ parse_set(struct tokenlist *tl)
vcc_RateVal(tl);
else if (vp->fmt == FLOAT)
Fb(tl, 0, "%g", vcc_DoubleVal(tl));
else if (vp->fmt == INT)
else if (vp->fmt == INT) {
Fb(tl, 0, "%u", vcc_UintVal(tl));
else {
vcc_NextToken(tl);
} else {
vsb_printf(tl->sb, "Cannot assign this variable type.\n");
vcc_ErrWhere(tl, vt);
return;
......
......@@ -150,7 +150,6 @@ vcc_UintVal(struct tokenlist *tl)
d *= 10;
d += *p - '0';
}
vcc_NextToken(tl);
return (d);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment