Граф коммитов

9 Коммитов

Автор SHA1 Сообщение Дата
Junio C Hamano 9aa23094c2 mailinfo: apply the same fix not to lose NULs in BASE64 and QP codepaths
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-25 13:22:18 -07:00
Johannes Schindelin cce8d6fdb4 mailsplit and mailinfo: gracefully handle NUL characters
The function fgets() has a big problem with NUL characters: it reads
them, but nobody will know if the NUL comes from the file stream, or
was appended at the end of the line.

So implement a custom read_line_with_nul() function.

Noticed by Tommy Thorn.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-25 13:21:40 -07:00
Jay Soffian 87f1b8849b mailinfo: feed only one line to handle_filter() for QP input
The function is intended to be fed one logical line at a time to
inspect, but a QP encoded raw input line can have more than one
lines, just like BASE64 encoded one.

Quoting LF as =0A may be unusual but RFC2045 allows it.

The issue was noticed and fixed by Jay Soffian.  JC added a test
to protect the fix from regressing later.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 22:16:34 -08:00
Simon Sasburg f88a545a94 Make mailsplit and mailinfo strip whitespace from the start of the input
Signed-off-by: Simon Sasburg <Simon.Sasburg@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-02 01:58:40 -07:00
Don Zickus 86747c132b git-mailinfo fixes for patch munging
Don't translate the patch to UTF-8, instead preserve the data as
is.  This also reverts a test case that was included in the
original patch series.

Also allow overwriting the authorship and title information we
gather from RFC2822 mail headers with additional in-body
headers, which was pointed out by Linus.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31 00:59:19 -07:00
Don Zickus ae1a743735 Add a couple more test cases to the suite.
They handle cases where there is no attached patch.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12 23:33:41 -07:00
Don Zickus 87ab799234 builtin-mailinfo.c infrastrcture changes
I am working on a project that required parsing through regular
mboxes that didn't necessarily have patches embedded in them.  I
started by creating my own modified copy of git-am and working
from there.  Very quickly, I noticed git-mailinfo wasn't able to
handle a big chunk of my email.

After hacking up numerous solutions and running into more
limitations, I decided it was just easier to rewrite a big chunk
of it.  The following patch has a bunch of fixes and features
that I needed in order for me do what I wanted.

Note: I'm didn't follow any email rfc papers but I don't think
any of the changes I did required much knowledge (besides the
boundary stuff).

List of major changes/fixes:
- can't create empty patch files fix
- empty patch files don't fail, this failure will come inside git-am
- multipart boundaries are now handled
- only output inbody headers if a patch exists otherwise assume those
headers are part of the reply and instead output the original headers
- decode and filter base64 patches correctly
- various other accidental fixes

I believe I didn't break any existing functionality or
compatibility (other than what I describe above, which is really
only the empty patch file).

I tested this through various mailing list archives and
everything seemed to parse correctly (a couple thousand emails).

[jc: squashed in another patch from Don's five patch series to
 fix the test case, as this patch exposes the bug in the test.]

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12 23:33:41 -07:00
Linus Torvalds 34fc5cefa7 mailinfo: do not get confused with logical lines that are too long.
It basically considers all the continuation lines to be lines of their
own, and if the total line is bigger than what we can fit in it, we just
truncate the result rather than stop in the middle and then get confused
when we try to parse the "next" line (which is just the remainder of the
first line).

[jc: added test, and tightened boundary a bit per list discussion.]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-27 01:02:32 -08:00
Junio C Hamano 4839c0b5fa t5100: mailinfo and mailsplit tests.
Currently the test passes with 1.3.3 but not with the tip of
"master".  This is to verify the fixes from Eric W Biedermann.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-17 16:26:20 -07:00