Commit 896aa8dc authored by Federico G. Schwindt's avatar Federico G. Schwindt

Fix regex matches in some esoteric cases

E.g. set req.http.foo = req.http.foo + req.http.bar ~ "foobar"
parent 16977fcc
......@@ -120,10 +120,8 @@ varnish v1 -vcl {
set req.http.foo = 3.0 * 2;
set req.http.foo = 3.0 / 2;
set req.http.foo = req.http.foo ~ "bar";
set req.http.foo = req.http.foo !~ "bar";
set req.http.foo = "foo" ~ "bar";
set req.http.foo = "foo" !~ "bar";
set req.http.foo = req.http.foo + "bar" ~ "bar";
set req.http.foo = req.http.foo + "bar" !~ "bar";
set req.ttl = 1s;
}
......
......@@ -1147,6 +1147,8 @@ vcc_expr_cmp(struct vcc *tl, struct expr **e, vcc_type_t fmt)
}
if (((*e)->fmt == STRING || (*e)->fmt == STRING_LIST) &&
(tl->t->tok == '~' || tl->t->tok == T_NOMATCH)) {
if ((*e)->fmt == STRING_LIST)
vcc_expr_tostring(tl, e, STRING);
not = tl->t->tok == '~' ? "" : "!";
vcc_NextToken(tl);
ExpectErr(tl, CSTR);
......
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