diff options
author | Ben Straub <bs@github.com> | 2013-09-23 11:37:35 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-09-24 11:18:43 -0700 |
commit | c91444055ab76f0f638a7926d8be8418fef2db0d (patch) | |
tree | ce3f4454192033b957f1ec50d9865dc8b5df6b32 /src/netops.c | |
parent | 210d5325262fb8d5ae553fcdba6f3c045db3e1de (diff) | |
download | libgit2-c91444055ab76f0f638a7926d8be8418fef2db0d.tar.gz |
Properly parse urls that include protocol://
Diffstat (limited to 'src/netops.c')
-rw-r--r-- | src/netops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/netops.c b/src/netops.c index 803c2696a..6777ee51b 100644 --- a/src/netops.c +++ b/src/netops.c @@ -581,7 +581,7 @@ int gitno_extract_url_parts( const char *url, const char *default_port) { - char *colon, *slash, *at, *end; + char *colon, *dblslash, *slash, *at, *end; const char *start; /* @@ -589,6 +589,9 @@ int gitno_extract_url_parts( * ==> [user[:pass]@]hostname.tld[:port]/resource */ + dblslash = strstr(url, "://"); + if (dblslash) url = dblslash+3; + colon = strchr(url, ':'); slash = strchr(url, '/'); at = strchr(url, '@'); |