| 22 |
|
#include <io.h> /* _open_osfhandle() */ |
| 23 |
|
#include <fcntl.h> /* _O_RDONLY */ |
| 24 |
|
|
| 25 |
+ |
#include "paths.h" |
| 26 |
|
#include "rtio.h" |
| 27 |
|
#include "rterror.h" |
| 28 |
|
|
| 65 |
|
int n, i, mode = 0, append = 0; |
| 66 |
|
int ncmds = 0; |
| 67 |
|
FILE *inf = NULL; |
| 68 |
+ |
char *s = NULL; |
| 69 |
|
HANDLE stdoutRd = NULL, stdoutWr = NULL; |
| 70 |
|
HANDLE stdinRd = NULL, stdinWr = NULL; |
| 71 |
|
HANDLE stderrWr = NULL; |
| 81 |
|
eputs(estr); |
| 82 |
|
return NULL; |
| 83 |
|
} |
| 84 |
+ |
/* single quotes aren't removed, so change to double-quotes */ |
| 85 |
+ |
for (s=command; *s; s++) |
| 86 |
+ |
if (*s == '\'') |
| 87 |
+ |
*s = '"'; |
| 88 |
|
|
| 89 |
|
stdoutOrig = GetStdHandle(STD_OUTPUT_HANDLE); |
| 90 |
|
stdinOrig = GetStdHandle(STD_INPUT_HANDLE); |
| 331 |
|
curs = NULL; |
| 332 |
|
} else if (last == '>') { /* output file */ |
| 333 |
|
if (*outfn != NULL) { |
| 334 |
< |
eputs("win_popen(): ambiguous out redirection"); |
| 334 |
> |
eputs("win_popen(): ambiguous output redirection"); |
| 335 |
|
goto error; |
| 336 |
|
} |
| 337 |
|
*outfn = curs; |