Code

Fix git protocol connection 'port' override
authorLinus Torvalds <torvalds@g5.osdl.org>
Sat, 23 Jul 2005 18:10:21 +0000 (11:10 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 23 Jul 2005 18:10:21 +0000 (11:10 -0700)
It was broken by the IPv6 patches - we need to remove the ":" part from
the hostname for a successful name lookup.

connect.c

index dcbbefa69f20027dc62d284e01e3482677c172ae..a910af93d8ccf4305dd7e3400f4602184a7c6810 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -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;