From d7d77314d86552133d68d79cf1f6e85312d5055e Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 15 Feb 2008 12:42:48 +0000 Subject: [PATCH] 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 --- varnish-cache/lib/libvcl/vcc_acl.c | 1 + varnish-cache/lib/libvcl/vcc_action.c | 10 ++++++---- varnish-cache/lib/libvcl/vcc_parse.c | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) 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); } -- 2.39.5