Mailing List Archive

r2479 - trunk/varnish-cache/lib/libvcl
Author: phk
Date: 2008-02-15 13:42:48 +0100 (Fri, 15 Feb 2008)
New Revision: 2479

Modified:
trunk/varnish-cache/lib/libvcl/vcc_acl.c
trunk/varnish-cache/lib/libvcl/vcc_action.c
trunk/varnish-cache/lib/libvcl/vcc_parse.c
Log:
Don't advance the token in vcc_UintVal(), that prevents precise
error messages based on the value of the integer.


Modified: trunk/varnish-cache/lib/libvcl/vcc_acl.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_acl.c 2008-02-15 12:30:47 UTC (rev 2478)
+++ trunk/varnish-cache/lib/libvcl/vcc_acl.c 2008-02-15 12:42:48 UTC (rev 2479)
@@ -75,6 +75,7 @@
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);

Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_action.c 2008-02-15 12:30:47 UTC (rev 2478)
+++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2008-02-15 12:42:48 UTC (rev 2479)
@@ -97,9 +97,10 @@
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 @@
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;

Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-02-15 12:30:47 UTC (rev 2478)
+++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-02-15 12:42:48 UTC (rev 2479)
@@ -150,7 +150,6 @@
d *= 10;
d += *p - '0';
}
- vcc_NextToken(tl);
return (d);
}