[Mplayer-cvslog] CVS: main/input input.c,1.81,1.82

Alban Bedel CVS albeu at mplayerhq.hu
Fri Aug 15 20:46:06 CEST 2003


Update of /cvsroot/mplayer/main/input
In directory mail:/var/tmp.root/cvs-serv10913/input

Modified Files:
	input.c 
Log Message:
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


Index: input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- input.c	13 Aug 2003 16:29:26 -0000	1.81
+++ input.c	15 Aug 2003 18:45:08 -0000	1.82
@@ -601,14 +601,15 @@
 	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;



More information about the MPlayer-cvslog mailing list