git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: johan defries <johandefries@gmail.com>,
	git@vger.kernel.org, gitter.spiros@gmail.com
Subject: Re: compile error in Git v2.7.0-rc0
Date: Mon, 14 Dec 2015 15:52:41 -0500	[thread overview]
Message-ID: <20151214205241.GB14788@sigill.intra.peff.net> (raw)
In-Reply-To: <20151214204624.GA14788@sigill.intra.peff.net>

On Mon, Dec 14, 2015 at 03:46:25PM -0500, Jeff King wrote:

> I don't think that fix is right, though. We should be passing "host" to
> gethostbyname.

Here it is in patch form. It can go on top of ep/ident-with-getaddrinfo.

-- >8 --
Subject: [PATCH] ident: fix undefined variable when NO_IPV6 is set

Commit 00bce77 (ident.c: add support for IPv6, 2015-11-27)
moved the "gethostbyname" call out of "add_domainname" and
into the helper function "canonical_name". But when moving
the code, it forgot that the "buf" variable is passed as
"host" in the helper.

Reported-by: johan defries <johandefries@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
---
 ident.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ident.c b/ident.c
index 4e7f99d..00a62e0 100644
--- a/ident.c
+++ b/ident.c
@@ -86,7 +86,7 @@ static int canonical_name(const char *host, struct strbuf *out)
 		freeaddrinfo(ai);
 	}
 #else
-	struct hostent *he = gethostbyname(buf);
+	struct hostent *he = gethostbyname(host);
 	if (he && strchr(he->h_name, '.')) {
 		strbuf_addstr(out, he->h_name);
 		status = 0;
-- 
2.7.0.rc0.348.g8e7037f

  reply	other threads:[~2015-12-14 20:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 20:28 compile error in Git v2.7.0-rc0 johan defries
2015-12-14 20:35 ` Junio C Hamano
2015-12-14 20:46   ` Jeff King
2015-12-14 20:52     ` Jeff King [this message]
2015-12-14 21:11       ` Junio C Hamano

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=20151214205241.GB14788@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=gitter.spiros@gmail.com \
    --cc=johandefries@gmail.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).