Commit c9f721bb authored by Federico G. Schwindt's avatar Federico G. Schwindt

Don't treat sub none specially

parent 7427860f
......@@ -40,7 +40,6 @@ varnish v1 -errvcl "Function recurses on" {
sub vcl_recv { call foo; }
}
varnish v1 -errvcl {Unused acl foo, defined:} {
backend b { .host = "127.0.0.1"; }
......@@ -54,6 +53,14 @@ varnish v1 -errvcl {Unused sub foo, defined:} {
sub foo {
}
}
varnish v1 -errvcl {Unused sub none, defined:} {
backend b { .host = "127.0.0.1"; }
sub none {
}
}
varnish v1 -errvcl {Invalid return "deliver"} {
backend b { .host = "127.0.0.1"; }
......
......@@ -133,12 +133,12 @@ New_IniFin(struct vcc *tl)
int
IsMethod(const struct token *t)
{
struct method *m;
int i;
assert(t->tok == ID);
for(m = method_tab; m->name != NULL; m++) {
if (vcc_IdIs(t, m->name))
return (m - method_tab);
for (i = 1; method_tab[i].name != NULL; i++) {
if (vcc_IdIs(t, method_tab[i].name))
return (i);
}
if ((t->b[0] == 'v'|| t->b[0] == 'V') &&
(t->b[1] == 'c'|| t->b[1] == 'C') &&
......
......@@ -220,7 +220,7 @@ vcc_ParseFunction(struct vcc *tl)
"VCL sub's named 'vcl*' are reserved names.\n");
vcc_ErrWhere(tl, tl->t);
VSB_printf(tl->sb, "Valid vcl_* methods are:\n");
for (i = 0; method_tab[i].name != NULL; i++)
for (i = 1; method_tab[i].name != NULL; i++)
VSB_printf(tl->sb, "\t%s\n", method_tab[i].name);
return;
} else if (m != -1) {
......
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