aboutsummaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-04-27 12:23:53 -0700
committerJunio C Hamano <gitster@pobox.com>2015-04-27 12:23:54 -0700
commitad34ad614da30387c82a54c7087705050b4de441 (patch)
tree998a6766aec9e4b9076a5a48c3f2fb64a1d2bdb4 /connect.c
parent89ba311df399d27a962b273e1acd95a38af2c821 (diff)
parent6b6c5f7a2f66751a93afce54277a1f30ab0dc521 (diff)
downloadgit-ad34ad614da30387c82a54c7087705050b4de441.tar.gz
git-ad34ad614da30387c82a54c7087705050b4de441.tar.xz
Merge branch 'tb/connect-ipv6-parse-fix' into maint
An earlier update to the parser that disects a URL broke an address, followed by a colon, followed by an empty string (instead of the port number), e.g. ssh://example.com:/path/to/repo. * tb/connect-ipv6-parse-fix: connect.c: ignore extra colon after hostname
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/connect.c b/connect.c
index ce0e12142..14c924b03 100644
--- a/connect.c
+++ b/connect.c
@@ -310,6 +310,8 @@ static void get_host_and_port(char **host, const char **port)
if (end != colon + 1 && *end == '\0' && 0 <= portnr && portnr < 65536) {
*colon = 0;
*port = colon + 1;
+ } else if (!colon[1]) {
+ *colon = 0;
}
}
}