From 5b59708268c82262fb13fb8681663dd158b030bd Mon Sep 17 00:00:00 2001 From: Steffen Prohaska Date: Tue, 11 Dec 2012 06:59:21 +0100 Subject: shortlog: fix wrapping lines of wraplen A recent commit [1] fixed a off-by-one wrapping error. As a side-effect, the conditional in add_wrapped_shortlog_msg() to decide whether to append a newline needs to be removed. The function should always append a newline, which was the case before the off-by-one fix, because strbuf_add_wrapped_text() never returns a value of wraplen; when it returns wraplen, the string does not end with a newline, so this caller needs to add one anyway. [1] 14e1a4e1ff70aff36db3f5d2a8b806efd0134d50 utf8: fix off-by-one wrapping of text Signed-off-by: Steffen Prohaska Signed-off-by: Junio C Hamano --- builtin/shortlog.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'builtin/shortlog.c') diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 37f3193a33..52f9284289 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -306,9 +306,8 @@ parse_done: static void add_wrapped_shortlog_msg(struct strbuf *sb, const char *s, const struct shortlog *log) { - int col = strbuf_add_wrapped_text(sb, s, log->in1, log->in2, log->wrap); - if (col != log->wrap) - strbuf_addch(sb, '\n'); + strbuf_add_wrapped_text(sb, s, log->in1, log->in2, log->wrap); + strbuf_addch(sb, '\n'); } void shortlog_output(struct shortlog *log) -- cgit v1.2.1