]> git.ipfire.org Git - thirdparty/git.git/commitdiff
print_wrapped_text: fix output for negative indent
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Fri, 2 Mar 2007 14:28:00 +0000 (15:28 +0100)
committerJunio C Hamano <junkio@cox.net>
Fri, 2 Mar 2007 23:14:48 +0000 (15:14 -0800)
When providing a negative indent, it means that -indent columns were
already printed. Fix a bug where the function ate the first character
if already the first word did not fit into the first line.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
utf8.c

diff --git a/utf8.c b/utf8.c
index ea23a6e5dc60bc3683c98a01f9a4e7dd8c7efb18..9e1a6d4964c04f21aff757534f09d013c64f5675 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -268,7 +268,7 @@ int print_wrapped_text(const char *text, int indent, int indent2, int width)
                        }
                        else {
                                putchar('\n');
-                               text = bol = space + 1;
+                               text = bol = space + isspace(*space);
                                space = NULL;
                                w = indent = indent2;
                        }