Update of /cvsroot/pure-data/externals/ggee/control In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25198
Modified Files: shell.c Log Message: exchanged execvp with system, fixes quoting problem
Index: shell.c =================================================================== RCS file: /cvsroot/pure-data/externals/ggee/control/shell.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shell.c 17 Sep 2003 07:25:13 -0000 1.6 --- shell.c 12 Aug 2004 08:39:19 -0000 1.7 *************** *** 1,5 **** /* (C) Guenter Geiger geiger@epy.co.at */
- #include <m_pd.h> #ifdef NT --- 1,4 ---- *************** *** 220,223 **** --- 219,227 ---- if (!(x->pid = fork())) { int status; + char* cmd = getbytes(1024); + char* tcmd = getbytes(1024); + strcpy(cmd,s->s_name); + + #if 0 for (i=1;i<=ac;i++) { argv[i] = getbytes(255); *************** *** 227,237 **** } argv[i] = 0;
/* reassign stdout */ dup2(x->fdpipe[1],1); dup2(x->fdinpipe[1],0); ! post("executing"); ! execvp(s->s_name,argv); ! exit(-1); } x->x_del = 4; --- 231,250 ---- } argv[i] = 0; + #endif + for (i=1;i<=ac;i++) { + atom_string(at,tcmd,255); + strcat(cmd," "); + strcat(cmd,tcmd); + at++; + }
+ /* reassign stdout */ dup2(x->fdpipe[1],1); dup2(x->fdinpipe[1],0); ! post("executing %s",cmd); ! system(cmd); ! // execvp(s->s_name,argv); ! exit(0); } x->x_del = 4;