git/t/t5100
Junio C Hamano a9fd1383a7 mailinfo: fix MIME multi-part message boundary handling
After finding a MIME multi-part message boundary line, the handle_body()
function is supposed to first flush any accumulated contents from the
previous part to the output stream.  However, the code mistakenly output
the boundary line it found.

The old code that used one global, fixed-length buffer line[] used an
alternate static buffer newline[] for keeping track of this accumulated
contents and flushed newline[] upon seeing the boundary; when 3b6121f
(git-mailinfo: use strbuf's instead of fixed buffers, 2008-07-13)
converted a fixed-length buffer in this program to use strbuf,these two
buffers were converted to "line" and "prev" (the latter of which now has a
much more sensible name) strbufs, but the code mistakenly flushed "line"
(which contains the boundary we have just found), instead of "prev".

This resulted in the first boundary to be output in front of the first
line of the message.

The rewritten implementation of handle_boundary() lost the terminating
newline; this would then result in the second line of the message to be
stuck with the first line.

The is_multipart_boundary() was designed to catch both the internal
boundary and the terminating one (the one with trailing "--"); this also
was broken with the rewrite, and the code in the handle_boundary() to
handle the terminating boundary was never triggered.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-09 01:26:35 -07:00
..
0010 git-mailinfo: Fix getting the subject from the in-body [PATCH] line 2008-07-13 17:21:15 -07:00
info0001 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
info0002 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
info0003 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
info0004 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
info0005 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
info0006 mailinfo: do not get confused with logical lines that are too long. 2007-02-27 01:02:32 -08:00
info0007 Add a couple more test cases to the suite. 2007-03-12 23:33:41 -07:00
info0008 Add a couple more test cases to the suite. 2007-03-12 23:33:41 -07:00
info0009 mailinfo: feed only one line to handle_filter() for QP input 2008-02-15 22:16:34 -08:00
info0010 git-mailinfo: Fix getting the subject from the in-body [PATCH] line 2008-07-13 17:21:15 -07:00
info0011 mailinfo: fix MIME multi-part message boundary handling 2008-08-09 01:26:35 -07:00
msg0001 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
msg0002 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
msg0003 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
msg0004 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
msg0005 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
msg0006 mailinfo: do not get confused with logical lines that are too long. 2007-02-27 01:02:32 -08:00
msg0007 Add a couple more test cases to the suite. 2007-03-12 23:33:41 -07:00
msg0008 Add a couple more test cases to the suite. 2007-03-12 23:33:41 -07:00
msg0009 mailinfo: feed only one line to handle_filter() for QP input 2008-02-15 22:16:34 -08:00
msg0010 git-mailinfo: Fix getting the subject from the in-body [PATCH] line 2008-07-13 17:21:15 -07:00
msg0011 mailinfo: fix MIME multi-part message boundary handling 2008-08-09 01:26:35 -07:00
nul-b64.expect mailinfo: apply the same fix not to lose NULs in BASE64 and QP codepaths 2008-05-25 13:22:18 -07:00
nul-b64.in mailinfo: apply the same fix not to lose NULs in BASE64 and QP codepaths 2008-05-25 13:22:18 -07:00
nul-plain t5100: Avoid filename "nul" 2008-05-27 23:12:29 -07:00
patch0001 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
patch0002 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
patch0003 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
patch0004 t5100: mailinfo and mailsplit tests. 2006-06-17 16:26:20 -07:00
patch0005 git-mailinfo fixes for patch munging 2007-03-31 00:59:19 -07:00
patch0006 mailinfo: do not get confused with logical lines that are too long. 2007-02-27 01:02:32 -08:00
patch0007 Add a couple more test cases to the suite. 2007-03-12 23:33:41 -07:00
patch0008 Add a couple more test cases to the suite. 2007-03-12 23:33:41 -07:00
patch0009 mailinfo: feed only one line to handle_filter() for QP input 2008-02-15 22:16:34 -08:00
patch0010 git-mailinfo: Fix getting the subject from the in-body [PATCH] line 2008-07-13 17:21:15 -07:00
patch0011 mailinfo: fix MIME multi-part message boundary handling 2008-08-09 01:26:35 -07:00
sample.mbox mailinfo: fix MIME multi-part message boundary handling 2008-08-09 01:26:35 -07:00