Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [regression] Re: [PATCHv2 10/15] drop length limitations on gecos-derived names and emails

From: Jeff King <hidden>
Date: 2016-06-15 22:55:54

Possibly related (same subject, not in this thread)

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 <redacted>
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help