Skip to content

Commit 9be0236

Browse files
author
albeu
committed
Fix a 10l and add escaped filename support. Needed by ftp.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10593 b3059339-0415-0410-9bf9-f77b7e298cf2
1 parent e5e805b commit 9be0236

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

m_option.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,8 @@ static int parse_custom_url(m_option_t* opt,char *name,
16721672
}
16731673
}
16741674
}
1675+
ptr1 = ptr2+1;
1676+
pos1 = ptr1-url;
16751677
}
16761678

16771679
// before looking for a port number check if we have an IPv6 type numeric address
@@ -1752,7 +1754,15 @@ static int parse_custom_url(m_option_t* opt,char *name,
17521754
// skip
17531755
} else {
17541756
if(dst) {
1755-
r = m_struct_set(desc,dst,"filename",ptr2+1);
1757+
int l = strlen(ptr2+1) + 1;
1758+
char* fname = ptr2+1;
1759+
if(l > 1) {
1760+
fname = malloc(l);
1761+
url_unescape_string(fname,ptr2+1);
1762+
}
1763+
r = m_struct_set(desc,dst,"filename",fname);
1764+
if(fname != ptr2+1)
1765+
free(fname);
17561766
if(r < 0) {
17571767
mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: error while setting filename\n",name);
17581768
return r;

0 commit comments

Comments
 (0)