mirror of https://github.com/mpv-player/mpv
stream/url.c: Unescape username/password when parsing URLs
This makes MPlayer handle it the same way as curl, and it also is the only method that works with http_proxy://...http://user:password@... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32621 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
111757c3f4
commit
c96f83c235
|
@ -152,7 +152,9 @@ url_new(const char* url) {
|
||||||
}
|
}
|
||||||
strncpy( Curl->password, ptr3+1, len2);
|
strncpy( Curl->password, ptr3+1, len2);
|
||||||
Curl->password[len2]='\0';
|
Curl->password[len2]='\0';
|
||||||
|
url_unescape_string(Curl->password, Curl->password);
|
||||||
}
|
}
|
||||||
|
url_unescape_string(Curl->username, Curl->username);
|
||||||
ptr1 = ptr2+1;
|
ptr1 = ptr2+1;
|
||||||
pos1 = ptr1-escfilename;
|
pos1 = ptr1-escfilename;
|
||||||
}
|
}
|
||||||
|
@ -251,7 +253,8 @@ url_free(URL_t* url) {
|
||||||
|
|
||||||
|
|
||||||
/* Replace escape sequences in an URL (or a part of an URL) */
|
/* Replace escape sequences in an URL (or a part of an URL) */
|
||||||
/* works like strcpy(), but without return argument */
|
/* works like strcpy(), but without return argument,
|
||||||
|
except that outbuf == inbuf is allowed */
|
||||||
void
|
void
|
||||||
url_unescape_string(char *outbuf, const char *inbuf)
|
url_unescape_string(char *outbuf, const char *inbuf)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue