From 4904cbc9e195f1de2cb6ff3c5b3d5b756343ef44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 24 Jun 2017 12:14:51 +0000 Subject: strbuf.h comment: discuss strbuf_addftime() arguments in order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the comment documenting the strbuf_addftime() function to discuss the parameters in the order in which they appear, which makes this easier to read than discussing them out of order. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- strbuf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'strbuf.h') diff --git a/strbuf.h b/strbuf.h index 4559035c47..6708cef0f9 100644 --- a/strbuf.h +++ b/strbuf.h @@ -340,10 +340,10 @@ extern void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap); /** * Add the time specified by `tm`, as formatted by `strftime`. - * `tz_name` is used to expand %Z internally unless it's NULL. * `tz_offset` is in decimal hhmm format, e.g. -600 means six hours west * of Greenwich, and it's used to expand %z internally. However, tokens * with modifiers (e.g. %Ez) are passed to `strftime`. + * `tz_name` is used to expand %Z internally unless it's NULL. */ extern void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm, int tz_offset, -- cgit v1.2.3 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 --- strbuf.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'strbuf.h') diff --git a/strbuf.h b/strbuf.h index 6708cef0f9..9262615ca0 100644 --- a/strbuf.h +++ b/strbuf.h @@ -343,11 +343,12 @@ extern void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap); * `tz_offset` is in decimal hhmm format, e.g. -600 means six hours west * of Greenwich, and it's used to expand %z internally. However, tokens * with modifiers (e.g. %Ez) are passed to `strftime`. - * `tz_name` is used to expand %Z internally unless it's NULL. + * `suppress_tz_name`, when set, expands %Z internally to the empty + * string rather than passing it to `strftime`. */ extern void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm, int tz_offset, - const char *tz_name); + int suppress_tz_name); /** * Read a given size of data from a FILE* pointer to the buffer. -- cgit v1.2.3