Commit c91444055ab76f0f638a7926d8be8418fef2db0d

Ben Straub 2013-09-23T11:37:35

Properly parse urls that include protocol://

diff --git a/src/netops.c b/src/netops.c
index 803c269..6777ee5 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, '@');