From: Sven Berkvens-M. <sv...@be...> - 2005-10-12 13:44:10
|
> Why is dvdvob.c constructing an string with sh -c "escaped_command" > in it anyway? popen() already runs an sh to interpret the string it is > given, and giving the literal string that was parsed from the XML > attribute should work fine... no need to escape anything in that case. I've removed the code from dvdvob.c with the following patch: --- src/dvdvob.c.orig Wed Oct 12 15:37:30 2005 +++ src/dvdvob.c Wed Oct 12 15:38:07 2005 @@ -570,22 +570,8 @@ int l=strlen(f); if( l>0 && f[l-1]=='|' ) { - char *str; - int i; - f[l-1]=0; - str=(char *)malloc(l*2+1+10); - strcpy(str,"sh -c \""); - l=strlen(str); - for( i=0; f[i]; i++ ) { - if( f[i]=='\"' || f[i]=='\'' ) - str[l++]='\\'; - str[l++]=f[i]; - } - str[l]=0; - strcpy(str+l,"\""); - h=popen(str,"r"); - free(str); + h=popen(f,"r"); ispipe[0]=1; } else if( !strcmp(f,"-") ) { h=stdin; This works as I expected and solves the problem with the double quote in my filename. -- Sven |