git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lukas Sandström" <lukass@etek.chalmers.se>
To: "Philippe Bruhat (BooK)" <book@cpan.org>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] mailinfo: better parse email adresses containg parentheses
Date: Mon, 21 Jul 2008 16:36:31 +0200	[thread overview]
Message-ID: <48849EEF.6070403@etek.chalmers.se> (raw)
In-Reply-To: <1216647269-12287-1-git-send-email-book@cpan.org>

Philippe Bruhat (BooK) wrote:
>     When using git-rebase, author fields containing a ')' at the last
>     position had the close-parens character incorrectly removed
>     because the From: parser incorrectly matched it as
> 
>         user@host (User Name)
> 
>     (removing parentheses), instead of
> 
>         User Name (me) <user@host>
> 
> Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org>

ACK.

> ---
>  builtin-mailinfo.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
> index b99a5b6..5581c9f 100644
> --- a/builtin-mailinfo.c
> +++ b/builtin-mailinfo.c
> @@ -115,10 +115,10 @@ static void handle_from(const struct strbuf *from)
>  	 * the () pair at the end.
>  	 */
>  	strbuf_trim(&f);
> -	if (f.buf[0] == '(')
> +	if (f.buf[0] == '(' && f.len && f.buf[f.len - 1] == ')') {
>  		strbuf_remove(&name, 0, 1);
Note: The line above should obviously be "strbuf_remove(&f, 0, 1);",
another error from the strbuf conversion I made. Sigh.

> -	if (f.len && f.buf[f.len - 1] == ')')
>  		strbuf_setlen(&f, f.len - 1);
> +	}
>  
>  	get_sane_name(&name, &f, &email);
>  	strbuf_release(&f);

/Lukas

  reply	other threads:[~2008-07-21 14:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 13:34 [PATCH] mailinfo: better parse email adresses containg parentheses Philippe Bruhat (BooK)
2008-07-21 14:36 ` Lukas Sandström [this message]
2008-07-22  3:16 ` Junio C Hamano
2008-07-22 10:24   ` Philippe Bruhat (BooK)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48849EEF.6070403@etek.chalmers.se \
    --to=lukass@etek.chalmers.se \
    --cc=book@cpan.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).