Re: [bug] blame duplicates trailing ">" in mailmapped emails
- From
Jeff King <peff@peff.net>
- Date
- Feb 4, 2012, 23:20 UTC
- Message-ID
- <20120204232015.GB1170@sigill.intra.peff.net>
- In-Reply-To
- <CAMP44s2r-fcnfpdT4u5U7TwF1z6Abp+J1U7oqfsSrYMuD6weOQ@mail.gmail.com>
On Sat, Feb 04, 2012 at 09:30:42PM +0200, Felipe Contreras wrote:
Show 8 quoted lines
> > but it feels like the fix should go into map_user. I tried a few things, > > like "git log -1 --format=%aE", and couldn't find other code paths with > > this problem. So presumably they are all feeding email addresses without > > the closing ">" (so one option is to just say "map_user needs to get > > NUL-terminated strings). > > Perhaps, but I though the idea was to make it efficient. I think the > above fix should be ok.
Because of the calling convention of map_user, the buffer with the input must also be writable (since it holds the result). So there should be no loss of efficiency to convert the ">" into a "\0" (and in fact, the simplest fix is probably to just have map_user "tie off" any ">" it detects).
> We should have tests for this though, to make sure it doesn't get > broken again. I'm on that.
Definitely. Thanks for working on it.
-Peff