From: phk Date: Fri, 15 Feb 2008 12:42:48 +0000 (+0000) Subject: Don't advance the token in vcc_UintVal(), that prevents precise X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7d77314d86552133d68d79cf1f6e85312d5055e;p=varnish Don't advance the token in vcc_UintVal(), that prevents precise error messages based on the value of the integer. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2479 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/lib/libvcl/vcc_acl.c b/varnish-cache/lib/libvcl/vcc_acl.c index 00d4d13e..a51b334b 100644 --- a/varnish-cache/lib/libvcl/vcc_acl.c +++ b/varnish-cache/lib/libvcl/vcc_acl.c @@ -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); diff --git a/varnish-cache/lib/libvcl/vcc_action.c b/varnish-cache/lib/libvcl/vcc_action.c index ebe8f447..95d5978c 100644 --- a/varnish-cache/lib/libvcl/vcc_action.c +++ b/varnish-cache/lib/libvcl/vcc_action.c @@ -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; diff --git a/varnish-cache/lib/libvcl/vcc_parse.c b/varnish-cache/lib/libvcl/vcc_parse.c index 09cd6c49..5861dbb5 100644 --- a/varnish-cache/lib/libvcl/vcc_parse.c +++ b/varnish-cache/lib/libvcl/vcc_parse.c @@ -150,7 +150,6 @@ vcc_UintVal(struct tokenlist *tl) d *= 10; d += *p - '0'; } - vcc_NextToken(tl); return (d); }