From cd74740b7a299f8eda3dc8a17d71129ffa4cbbd3 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Tue, 16 Sep 2008 11:26:48 +0200 Subject: [PATCH] Handle "now" specially "now" is special, just like regsub and friends. Handle that in vcc_StringVal. --- varnish-cache/lib/libvcl/vcc_string.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/varnish-cache/lib/libvcl/vcc_string.c b/varnish-cache/lib/libvcl/vcc_string.c index be6014d8..37fc1e0f 100644 --- a/varnish-cache/lib/libvcl/vcc_string.c +++ b/varnish-cache/lib/libvcl/vcc_string.c @@ -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) -- 2.39.5