--- ray/src/common/win_popen.c 2004/10/04 10:14:22 1.4 +++ ray/src/common/win_popen.c 2011/10/05 17:20:55 1.5 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: win_popen.c,v 1.4 2004/10/04 10:14:22 schorsch Exp $"; +static const char RCSid[] = "$Id: win_popen.c,v 1.5 2011/10/05 17:20:55 greg Exp $"; #endif /* Replacement for the posix popen() on Windows @@ -65,6 +65,7 @@ char* type int n, i, mode = 0, append = 0; int ncmds = 0; FILE *inf = NULL; + char *s = NULL; HANDLE stdoutRd = NULL, stdoutWr = NULL; HANDLE stdinRd = NULL, stdinWr = NULL; HANDLE stderrWr = NULL; @@ -80,6 +81,10 @@ char* type eputs(estr); return NULL; } + /* single quotes aren't removed, so change to double-quotes */ + for (s=command; *s; s++) + if (*s == '\'') + *s = '"'; stdoutOrig = GetStdHandle(STD_OUTPUT_HANDLE); stdinOrig = GetStdHandle(STD_INPUT_HANDLE);