summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a1f6baa)
raw | patch | inline | side by side (parent: a1f6baa)
author | Jeff King <peff@peff.net> | |
Wed, 23 Feb 2011 09:59:18 +0000 (04:59 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 24 Feb 2011 00:09:33 +0000 (16:09 -0800) |
These should generally never happen, as we already
concatenate multiples in subjects into a single line. But
let's be defensive, since not encoding them means we will
output malformed headers.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
concatenate multiples in subjects into a single line. But
let's be defensive, since not encoding them means we will
output malformed headers.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pretty.c | patch | blob | history |
diff --git a/pretty.c b/pretty.c
index 0e167f463f864ca5516d2d5cf7df8595226090d7..65d20a7a2e7cafd79ff95c02cab3303ebb72351c 100644 (file)
--- a/pretty.c
+++ b/pretty.c
for (i = 0; i < len; i++) {
int ch = line[i];
- if (non_ascii(ch))
+ if (non_ascii(ch) || ch == '\n')
goto needquote;
if ((i + 1 < len) && (ch == '=' && line[i+1] == '?'))
goto needquote;
* many programs do not understand this and just
* leave the underscore in place.
*/
- if (is_rfc2047_special(ch) || ch == ' ') {
+ if (is_rfc2047_special(ch) || ch == ' ' || ch == '\n') {
strbuf_addf(sb, "=%02X", ch);
line_len += 3;
}