From 38a2fa46fd084eb21a3b348e6f73fabd5d992edc Mon Sep 17 00:00:00 2001 From: albeu Date: Fri, 15 Aug 2003 18:45:35 +0000 Subject: 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. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- input/input.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'input') 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; -- cgit v1.2.3