Properly parse urls that include protocol://

This commit is contained in:
Ben Straub 2013-09-23 11:37:35 -07:00 committed by Russell Belfer
parent 210d532526
commit c91444055a

View File

@ -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, '@');