diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-09-21 02:30:24 +0300 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-30 19:50:17 +0100 |
commit | 7470b02ef4cd7a2eb2e0d13971d003067fd99025 (patch) | |
tree | 83b9bde512fd220fd122cedbf50f3ec4656b2a6b /m_option.c | |
parent | 85dbd9b8f6191a1f35ee4f9307b376874f977eb7 (diff) | |
download | mpv-7470b02ef4cd7a2eb2e0d13971d003067fd99025.tar.bz2 mpv-7470b02ef4cd7a2eb2e0d13971d003067fd99025.tar.xz |
options: fix URL user/password parsing
Code parsing the optional user/password part for some URL types given
as files to play, such as "ftp://user:password@host/filename", was
broken. Fix. I guess this isn't used much as nobody reported it
earlier.
Diffstat (limited to 'm_option.c')
-rw-r--r-- | m_option.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/m_option.c b/m_option.c index d48d4016b8..2ad80f6eef 100644 --- a/m_option.c +++ b/m_option.c @@ -1979,6 +1979,8 @@ static int parse_custom_url(const m_option_t *opt, struct bstr name, struct bstr path = bstr_cut(ptr1, idx); idx = bstrchr(hostpart, '@'); if (idx >= 0) { + struct bstr userpass = bstr_splice(hostpart, 0, idx); + hostpart = bstr_cut(hostpart, idx + 1); // We got something, at least a username... if (!m_option_list_find(desc->fields, "username")) { mp_msg(MSGT_CFGPARSER, MSGL_WARN, @@ -1986,7 +1988,6 @@ static int parse_custom_url(const m_option_t *opt, struct bstr name, BSTR_P(name)); // skip } else { - struct bstr userpass = bstr_splice(hostpart, 0, idx); idx = bstrchr(userpass, ':'); if (idx >= 0) { // We also have a password @@ -2026,7 +2027,6 @@ static int parse_custom_url(const m_option_t *opt, struct bstr name, } } } - hostpart = bstr_cut(hostpart, idx + 1); } // Before looking for a port number check if we have an IPv6 type |