Subject: Re: [BUG PATCH RFC] mailinfo: correctly handle multiline 'Subject:' header

From: Junio C Hamano <[email-masked]>
Date: Mon, 12 Jan 2009 15:27:44 -0800

Kirill Smelkov <[email-masked]> writes:

> diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
> index f7c8c08..6d72c1b 100644
> --- a/builtin-mailinfo.c
> +++ b/builtin-mailinfo.c
> @@ -860,6 +860,7 @@ static void handle_info(void)
>  			}
>  			output_header_lines(fout, "Subject", hdr);
>  		} else if (!memcmp(header[i], "From", 4)) {
> +			cleanup_space(hdr);
>  			handle_from(hdr);
>  			fprintf(fout, "Author: %s\n", name.buf);
>  			fprintf(fout, "Email: %s\n", email.buf);
> diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox
> index 4bf7947..d465685 100644
> --- a/t/t5100/sample.mbox
> +++ b/t/t5100/sample.mbox
> @@ -2,7 +2,10 @@
>  	
>      
>  From nobody Mon Sep 17 00:00:00 2001
> -From: A U Thor <[email-masked]>
> +From: A
> +      U
> +      Thor
> +      <[email-masked]>
>  Date: Fri, 9 Jun 2006 00:44:16 -0700
>  Subject: [PATCH] a commit.

I think this is a reasonable change.

But doesn't this

>  From nobody Mon Sep 17 00:00:00 2001
> -From: A
> +From: A (zzz)
>        U
>        Thor
> -      <[email-masked]>
> +      <[email-masked]> (Comment)

regress for people who spell their names like this?

	From: [email-masked] (John Doe)