Fix git protocol connection 'port' override

It was broken by the IPv6 patches - we need to remove the ":" part from
the hostname for a successful name lookup.
maint
Linus Torvalds 2005-07-23 11:10:21 -07:00
parent 5ba884483f
commit ce6f8e7ec2
1 changed files with 3 additions and 1 deletions

View File

@ -119,8 +119,10 @@ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path)
end = host; end = host;
colon = strchr(end, ':'); colon = strchr(end, ':');


if (colon) if (colon) {
*colon = 0;
port = colon + 1; port = colon + 1;
}


memset(&hints, 0, sizeof(hints)); memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;