summaryrefslogtreecommitdiff
path: root/src/net.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-12-17 20:53:11 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2020-12-23 12:00:34 +0000
commit27301cd02676e8e1247f36ff5bbd3ee9c2579ee1 (patch)
tree8709e65660f40893037d94950d7c3e10fafb4166 /src/net.c
parent953dee20c6ccb5cb9b5e89ae571bfd356fe21a0e (diff)
downloadlibgit2-27301cd02676e8e1247f36ff5bbd3ee9c2579ee1.tar.gz
net: function to identify ipv6 addresses in URLs
Diffstat (limited to 'src/net.c')
-rw-r--r--src/net.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net.c b/src/net.c
index d5662393a..d4a9f8a6d 100644
--- a/src/net.c
+++ b/src/net.c
@@ -345,6 +345,11 @@ bool git_net_url_is_default_port(git_net_url *url)
return false;
}
+bool git_net_url_is_ipv6(git_net_url *url)
+{
+ return (strchr(url->host, ':') != NULL);
+}
+
void git_net_url_swap(git_net_url *a, git_net_url *b)
{
git_net_url tmp = GIT_NET_URL_INIT;