Commit 9ea22d78 authored by Federico G. Schwindt's avatar Federico G. Schwindt

Fix incorrect representation when using reals

Fixes #1532
parent 455281a9
varnishtest "Incorrect representation when using reals - #1532"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_deliver {
set resp.http.x-foo = std.real2time(1140618699.00);
}
} -start
client c1 {
txreq
rxresp
expect resp.http.x-foo == "Wed, 22 Feb 2006 14:31:39 GMT"
} -run
......@@ -749,7 +749,7 @@ vcc_expr4(struct vcc *tl, struct expr **e, enum var_type fmt)
e1 = vcc_mk_expr(BYTES, "%.1f", d);
ERRCHK(tl);
} else if (fmt == REAL) {
e1 = vcc_mk_expr(REAL, "%g", vcc_DoubleVal(tl));
e1 = vcc_mk_expr(REAL, "%f", vcc_DoubleVal(tl));
ERRCHK(tl);
} else {
e1 = vcc_mk_expr(INT, "%.*s", PF(tl->t));
......
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