summaryrefslogtreecommitdiffstats
path: root/m_option.c
diff options
context:
space:
mode:
Diffstat (limited to 'm_option.c')
-rw-r--r--m_option.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/m_option.c b/m_option.c
index d48d4016b8..3f300326ca 100644
--- a/m_option.c
+++ b/m_option.c
@@ -746,13 +746,11 @@ static void free_str_list(void *dst)
static int str_list_add(char **add, int n, void *dst, int pre)
{
- char **lst = VAL(dst);
- int ln;
-
if (!dst)
return M_OPT_PARSER_ERR;
- lst = VAL(dst);
+ char **lst = VAL(dst);
+ int ln;
for (ln = 0; lst && lst[ln]; ln++)
/**/;
@@ -1979,6 +1977,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 +1986,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 +2025,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