Skip to content

Commit

Permalink
Fix git protocol connection 'port' override
Browse files Browse the repository at this point in the history
It was broken by the IPv6 patches - we need to remove the ":" part from
the hostname for a successful name lookup.
  • Loading branch information
Linus Torvalds committed Jul 23, 2005
1 parent 5ba8844 commit ce6f8e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path)
end = host;
colon = strchr(end, ':');

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

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

0 comments on commit ce6f8e7

Please sign in to comment.