Commit e7fc6542 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Dridi Boukelmoune

Handle string literal concatenation correctly.

Fixes #2685
parent 79c9415f
......@@ -10,6 +10,8 @@ server s1 {
} -start
varnish v1 -vcl+backend {
import std;
sub vcl_backend_response {
if (bereq.url == "/333") {
set beresp.status = 333;
......@@ -18,7 +20,7 @@ varnish v1 -vcl+backend {
}
sub vcl_deliver {
if (req.url == "/332") {
return (synth(332, "FOO"));
return (synth(332, "F" + "OO" + std.tolower("FOO")));
} else if (req.url == "/333") {
return (synth(resp.status + 1000,
resp.reason));
......@@ -64,6 +66,7 @@ client c2 {
txreq -url /332
rxresp
expect resp.status == 332
expect resp.reason == "FOOfoo"
expect resp.http.restarts == 1
expect resp.bodylen == 1
} -run
......@@ -920,6 +920,7 @@ vcc_expr_add(struct vcc *tl, struct expr **e, vcc_type_t fmt)
*e = vcc_expr_edit(tl, STRINGS,
"\v1\n\v2", *e, e2);
(*e)->constant = EXPR_CONST;
(*e)->nstr = 1;
if (lit)
(*e)->constant |= EXPR_STR_CONST;
} else {
......@@ -1297,6 +1298,8 @@ vcc_Expr(struct vcc *tl, vcc_type_t fmt)
assert(fmt != STRINGS);
vcc_expr0(tl, &e, fmt);
ERRCHK(tl);
assert(e->fmt == fmt);
vcc_expr_fmt(tl->fb, tl->indent, e);
VSB_printf(tl->fb, "\n");
vcc_delete_expr(e);
......
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