]> err.no Git - varnish/commitdiff
Handle "now" specially
authorTollef Fog Heen <tfheen@err.no>
Tue, 16 Sep 2008 09:26:48 +0000 (11:26 +0200)
committerTollef Fog Heen <tfheen@err.no>
Tue, 18 Nov 2008 20:57:16 +0000 (21:57 +0100)
"now" is special, just like regsub and friends.  Handle that in
vcc_StringVal.

varnish-cache/lib/libvcl/vcc_string.c

index be6014d8174772c8b2fbcba92f5024e5e78e272a..37fc1e0fd86c70d66a23a5a88b4899d3a91241bb 100644 (file)
@@ -141,6 +141,11 @@ vcc_StringVal(struct tokenlist *tl)
                return (vcc_regsub(tl, 0));
        if (tl->t->tok == ID && vcc_IdIs(tl->t, "regsuball"))
                return (vcc_regsub(tl, 1));
+       if (tl->t->tok == ID && vcc_IdIs(tl->t, "now")) {
+               Fb(tl, 0, "VRT_time_string(sp, VRT_r_now(sp))");
+               vcc_NextToken(tl);
+               return (1);
+       }
        if (tl->t->tok == VAR) {
                vp = vcc_FindVar(tl, tl->t, vcc_vars);
                if (tl->err)