<div dir="ltr">Bah, the message should read:<div><br></div><div><span style="font-size:12.8px">Handle integers in boolean statements</span><br style="font-size:12.8px"></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I haven't updated the documentation as I want to talk to Dridi first.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 13, 2016 at 11:47 PM, Federico G. Schwindt <span dir="ltr"><<a href="mailto:fgsch@lodoss.net" target="_blank">fgsch@lodoss.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
commit 50515b2214d38d1eba0331aa0b88e9<wbr>e6b6687da7<br>
Author: Federico G. Schwindt <<a href="mailto:fgsch@lodoss.net">fgsch@lodoss.net</a>><br>
Date: Tue Sep 13 23:40:04 2016 +0100<br>
<br>
Handle integers in boolean expressions<br>
<br>
Zero is false, all other values are true.<br>
<br>
diff --git a/bin/varnishtest/tests/<wbr>v00020.vtc b/bin/varnishtest/tests/<wbr>v00020.vtc<br>
index cd0ab28..3fd7e69 100644<br>
--- a/bin/varnishtest/tests/<wbr>v00020.vtc<br>
+++ b/bin/varnishtest/tests/<wbr>v00020.vtc<br>
@@ -127,6 +127,16 @@ varnish v1 -vcl {<br>
}<br>
}<br>
<br>
+<br>
+varnish v1 -vcl {<br>
+ import std;<br>
+ backend b { .host = "127.0.0.1"; }<br>
+ sub vcl_recv {<br>
+ if (std.integer("1", 1)) {<br>
+ }<br>
+ }<br>
+}<br>
+<br>
# XXX: not the most clear error message<br>
varnish v1 -errvcl {STRING - STRING not possible.} {<br>
backend b { .host = "127.0.0.1"; }<br>
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c<br>
index 4ced132..7d594cf 100644<br>
--- a/lib/libvcc/vcc_expr.c<br>
+++ b/lib/libvcc/vcc_expr.c<br>
@@ -1200,7 +1200,9 @@ vcc_expr_cmp(struct vcc *tl, struct expr **e, vcc_type_t fmt)<br>
default:<br>
break;<br>
}<br>
- if (fmt == BOOL && ((*e)->fmt == STRING || (*e)->fmt == BACKEND)) {<br>
+ if (fmt == BOOL &&<br>
+ ((*e)->fmt == STRING || (*e)->fmt == BACKEND ||<br>
+ (*e)->fmt == INT)) {<br>
*e = vcc_expr_edit(BOOL, "(\v1 != 0)", *e, NULL);<br>
return;<br>
}<br>
<br>
______________________________<wbr>_________________<br>
varnish-commit mailing list<br>
<a href="mailto:varnish-commit@varnish-cache.org">varnish-commit@varnish-cache.<wbr>org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-commit</a><br>
</blockquote></div><br></div>