From f866ded1b9d248e09a032c346f4588e374caedc5 Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Thu, 12 Aug 2004 08:39:19 +0000 Subject: exchanged execvp with system, fixes quoting problem svn path=/trunk/externals/ggee/; revision=1941 --- control/shell.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'control/shell.c') diff --git a/control/shell.c b/control/shell.c index 6a89aea..5476e97 100755 --- a/control/shell.c +++ b/control/shell.c @@ -1,6 +1,5 @@ /* (C) Guenter Geiger */ - #include #ifdef NT #pragma warning( disable : 4244 ) @@ -219,6 +218,11 @@ static void shell_anything(t_shell *x, t_symbol *s, int ac, t_atom *at) 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); atom_string(at,argv[i],255); @@ -226,13 +230,22 @@ static void shell_anything(t_shell *x, t_symbol *s, int ac, t_atom *at) at++; } 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"); - execvp(s->s_name,argv); - exit(-1); + post("executing %s",cmd); + system(cmd); +// execvp(s->s_name,argv); + exit(0); } x->x_del = 4; clock_delay(x->x_clock,x->x_del); -- cgit v1.2.1