Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
trace2: trim trailing whitespace in normal format error message
author
Jeff Hostetler
<jeffhost@microsoft.com>
Thu, 8 Aug 2019 14:19:02 +0000
(07:19 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 8 Aug 2019 17:39:44 +0000
(10:39 -0700)
Avoid creating unnecessary trailing whitespace in normal
target format error messages when the message is omitted.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
trace2/tr2_tgt_normal.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
04f10d3
)
diff --git
a/trace2/tr2_tgt_normal.c
b/trace2/tr2_tgt_normal.c
index 47a18825573b634008069fbf4b09b9f4a95d53b2..213724d5cb92649192e8fab06b4b5283a8b0319b 100644
(file)
--- a/
trace2/tr2_tgt_normal.c
+++ b/
trace2/tr2_tgt_normal.c
@@
-142,8
+142,11
@@
static void fn_error_va_fl(const char *file, int line, const char *fmt,
{
struct strbuf buf_payload = STRBUF_INIT;
- strbuf_addstr(&buf_payload, "error ");
- maybe_append_string_va(&buf_payload, fmt, ap);
+ strbuf_addstr(&buf_payload, "error");
+ if (fmt && *fmt) {
+ strbuf_addch(&buf_payload, ' ');
+ maybe_append_string_va(&buf_payload, fmt, ap);
+ }
normal_io_write_fl(file, line, &buf_payload);
strbuf_release(&buf_payload);
}