From 1416ceb57589ba119a36d9f32d919d3444f7b0d0 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 14 Mar 2019 21:27:26 +0000 Subject: Accept 0 time as a shorthand for now to format_expand_time. --- format.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'format.c') diff --git a/format.c b/format.c index ae3086d1..6f042f8a 100644 --- a/format.c +++ b/format.c @@ -1482,6 +1482,8 @@ format_expand_time(struct format_tree *ft, const char *fmt, time_t t) if (fmt == NULL || *fmt == '\0') return (xstrdup("")); + if (t == 0) + t = time(NULL); tm = localtime(&t); if (strftime(s, sizeof s, fmt, tm) == 0) -- cgit