summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJan H. Schönherr <schnhrr@cs.tu-berlin.de>2012-10-18 16:43:29 +0200
committerJunio C Hamano <gitster@pobox.com>2012-10-18 14:23:12 -0700
commit7a76e68a177720da65e7d9cfa49d702a55e2d9de (patch)
treee8d03be40b9710b0887c4836fea465c56b30d7f8 /pretty.c
parent14e1a4e1ff70aff36db3f5d2a8b806efd0134d50 (diff)
downloadgit-7a76e68a177720da65e7d9cfa49d702a55e2d9de.tar.gz
format-patch: do not wrap non-rfc2047 headers too early
Do not wrap the second and later lines of non-rfc2047-encoded headers substantially before the 78 character limit. Instead of passing the remaining length of the first line as wrapping width, use the correct maximum length and tell strbuf_add_wrapped_bytes() how many characters of the first line are already used. Signed-off-by: Jan H. Schönherr <schnhrr@cs.tu-berlin.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pretty.c b/pretty.c
index 8b1ea9ffad..71e4024663 100644
--- a/pretty.c
+++ b/pretty.c
@@ -286,7 +286,7 @@ static void add_rfc2047(struct strbuf *sb, const char *line, int len,
if ((i + 1 < len) && (ch == '=' && line[i+1] == '?'))
goto needquote;
}
- strbuf_add_wrapped_bytes(sb, line, len, 0, 1, max_length - line_len);
+ strbuf_add_wrapped_bytes(sb, line, len, -line_len, 1, max_length);
return;
needquote: