On Fri, Jan 25, 2013 at 10:46:48AM -0800, Junio C Hamano wrote:

> Will queue this one, to be merged to 'maint' and 'master'.
> 
> -- >8 --
> From: Jonathan Nieder <jrnie...@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:

> -     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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to