Re: [regression] Re: [PATCHv2 10/15] drop length limitations on gecos-derived names and emails
- From
Jeff King <peff@peff.net>
- Date
- Jan 25, 2013, 22:10 UTC
- Message-ID
- <20130125221030.GC23626@sigill.intra.peff.net>
- In-Reply-To
- <7vtxq53xt3.fsf@alter.siamese.dyndns.org>
On Fri, Jan 25, 2013 at 10:46:48AM -0800, Junio C Hamano wrote:
Show 6 quoted lines
> Will queue this one, to be merged to 'maint' and 'master'. > > -- >8 -- > From: Jonathan Nieder <jrnieder@gmail.com> > Date: Thu, 24 Jan 2013 15:21:46 -0800 > Subject: [PATCH] ident: do not drop username when reading from /etc/mailname
Thanks, looks fine to me (and thanks to Jonathan). One nit:
Show 9 quoted lines
> - if (strbuf_getline(buf, mailname, '\n') == EOF) {
> + if (strbuf_getline(&mailnamebuf, mailname, '\n') == EOF) {
> if (ferror(mailname))
> warning("cannot read /etc/mailname: %s",
> strerror(errno));
> + strbuf_release(&mailnamebuf);
> fclose(mailname);
> return -1;
> }This strbuf_release is unnecessary, as an EOF return by definition means we did not read anything. I don't mind it as a defensive measure, though, in case the strbuf implementation changes to pre-allocate.
-Peff