]> err.no Git - varnish/commitdiff
Don't advance the token in vcc_UintVal(), that prevents precise
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Feb 2008 12:42:48 +0000 (12:42 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Feb 2008 12:42:48 +0000 (12:42 +0000)
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
varnish-cache/lib/libvcl/vcc_action.c
varnish-cache/lib/libvcl/vcc_parse.c

index 00d4d13ec2440712f732cf5fb2d5f6a46ad515b7..a51b334bbb1f9f22c4d78e5b9f139a8d10d36ff4 100644 (file)
@@ -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);
index ebe8f447c73e1d40ded2cab4614bc8e04e93b666..95d5978cc4dbe0ab8f6b1a73d88868946a661584 100644 (file)
@@ -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;
index 09cd6c492a7f2ee995307b5344fbf54ea0c6bd4b..5861dbb5d60e77e1abd20919bb0e50525d5bd7ea 100644 (file)
@@ -150,7 +150,6 @@ vcc_UintVal(struct tokenlist *tl)
                d *= 10;
                d += *p - '0';
        }
-       vcc_NextToken(tl);
        return (d);
 }