Commit 202f9ae0 authored by Jérome Decoodt's avatar Jérome Decoodt

Fix user:pass parsing if protocol is not given.

Not tested with all calls (only http access module)
parent 3c047a9d
......@@ -112,25 +112,24 @@ static inline void vlc_UrlParse( vlc_url_t *url, const char *psz_url,
if( p[1] == '/' )
p += 2;
url->psz_protocol = psz_parse;
psz_parse = p;
p = strchr( psz_parse, '@' );
if( p != NULL )
{
/* We have a login */
url->psz_username = psz_parse;
*p++ = '\0';
psz_parse = strchr( psz_parse, ':' );
if( psz_parse != NULL )
{
/* We have a password */
*psz_parse++ = '\0';
url->psz_password = psz_parse;
}
}
p = strchr( psz_parse, '@' );
if( p != NULL )
{
/* We have a login */
url->psz_username = psz_parse;
*p++ = '\0';
psz_parse = p;
psz_parse = strchr( psz_parse, ':' );
if( psz_parse != NULL )
{
/* We have a password */
*psz_parse++ = '\0';
url->psz_password = psz_parse;
}
psz_parse = p;
}
p = strchr( psz_parse, '/' );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment