summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-15 18:45:35 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-15 18:45:35 +0000
commit38a2fa46fd084eb21a3b348e6f73fabd5d992edc (patch)
tree95aacde47bb2eabad7b1305c56e1deb46e1df9de /input/input.c
parent9646f76179ad4536d0c631353f02f2d86929bc4d (diff)
downloadmpv-38a2fa46fd084eb21a3b348e6f73fabd5d992edc.tar.bz2
mpv-38a2fa46fd084eb21a3b348e6f73fabd5d992edc.tar.xz
I've juste found a bug which prevent to load a file whose name contain
a quote ('). The menu simply execute a "loadfile '%p'" but when the %p is replaced by the actual value, quotes in it are not escaped ! Moreover, mp_input_parse_cmd contain some code to unescape strings but this code was placed after the string was copied in his final buffer. So this patch correct this issue. By Aurélien Jacobs git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10625 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'input/input.c')
-rw-r--r--input/input.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/input/input.c b/input/input.c
index 932d1a13f6..c0cf9bc8bd 100644
--- a/input/input.c
+++ b/input/input.c
@@ -601,14 +601,15 @@ mp_input_parse_cmd(char* str) {
break;
} else if(!e) e = ptr+strlen(ptr);
l = e-start;
- cmd->args[i].v.s = (char*)malloc((l+1)*sizeof(char));
- strncpy(cmd->args[i].v.s,start,l);
- cmd->args[i].v.s[l] = '\0';
ptr2 = start;
for(e = strchr(ptr2,'\\') ; e ; e = strchr(ptr2,'\\')) {
memmove(e,e+1,strlen(e));
ptr2 = e + 1;
+ l--;
}
+ cmd->args[i].v.s = (char*)malloc((l+1)*sizeof(char));
+ strncpy(cmd->args[i].v.s,start,l);
+ cmd->args[i].v.s[l] = '\0';
} break;
case -1:
ptr = NULL;