git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] mailinfo: ensure handle_filter gets only one line at a time

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 15, 2008, 23:24 UTC
Message-ID
<7vodahg5w4.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1203112418-25199-1-git-send-email-jaysoffian@gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
Show 8 quoted lines
> handle_filter() is only supposed to get one line at a time.
> handle_body() already ensures this after decoding BASE64 messages per
> this comment:
>
> /* this is a decoded line that may contain
>  * multiple new lines.  Pass only one chunk
>  * at a time to handle_filter()
>

Good eyes. Although I do not think we need to quote in-code comments here ;-)

Show 23 quoted lines
> QP messages need to be similarly processed since decoding QP can also
> add newlines.
>
> Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
> ---
> I broke this change out into it's own patch since it's independent of
> the format=flowed additions.
>
>  builtin-mailinfo.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
> index 2600847..11f154b 100644
> --- a/builtin-mailinfo.c
> +++ b/builtin-mailinfo.c
> @@ -818,6 +818,7 @@ static void handle_body(void)
>  
>  		switch (transfer_encoding) {
>  		case TE_BASE64:
> +		case TE_QP:
>  		{
>  			char *op = line;
>  

And it appears to be an obvious fix that should even go to 'maint' where no new features will land.

Care to provide a test case for this one?
Previous: Jay SoffianNext: Jay Soffian
Message 4 of 8 in “mailinfo: ensure handle_filter gets only one line at a time”
  1. 1/3 mailinfo: ensure handle_filter gets only one line at a timeJay Soffian, Feb 15, 2008
  2. 2/3 mailinfo: support rfc3676 (format=flowed) text/plain messagesJay Soffian, Feb 15, 2008
  3. 3/3 test mailinfo rfc3676 supportJay Soffian, Feb 15, 2008
  4. Junio C HamanoFeb 15, 2008
  5. Jay SoffianFeb 15, 2008
  6. Junio C HamanoFeb 16, 2008
  7. Junio C HamanoFeb 16, 2008
  8. Jay SoffianFeb 16, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.