From 3b702239d6399685aa69539b83be5f744cfa10e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 1 Jul 2017 13:15:47 +0000 Subject: strbuf: change an always NULL/"" strbuf_addftime() param to bool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit strbuf_addftime() allows callers to pass a time zone name for expanding %Z. The only current caller either passes the empty string or NULL, in which case %Z is handed over verbatim to strftime(3). Replace that string parameter with a flag controlling whether to remove %Z from the format specification. This simplifies the code. Commit-message-by: René Scharfe Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- date.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'date.c') diff --git a/date.c b/date.c index 5580c40ac0..8aca136396 100644 --- a/date.c +++ b/date.c @@ -243,7 +243,7 @@ const char *show_date(unsigned long time, int tz, const struct date_mode *mode) tm->tm_hour, tm->tm_min, tm->tm_sec, tz); else if (mode->type == DATE_STRFTIME) strbuf_addftime(&timebuf, mode->strftime_fmt, tm, tz, - mode->local ? NULL : ""); + !mode->local); else strbuf_addf(&timebuf, "%.3s %.3s %d %02d:%02d:%02d %d%c%+05d", weekday_names[tm->tm_wday], -- cgit v1.2.3