diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | stream.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,10 @@ 2012-05-18 Kaz Kylheku <kaz@kylheku.com> + * stream.c (open_pipev): Bugfix: program name is included + as first element of argv. + +2012-05-18 Kaz Kylheku <kaz@kylheku.com> + Implement open_pipev in terms of popen for Windows which does not have for or exec. We could use CreateProcess and CreatePipe, et cetera, but it won't buy us anything because the whole point @@ -1551,9 +1551,9 @@ val open_pipevp(val name, val mode_str, val args) name, num(errno), string_utf8(strerror(errno)), nao); } - argv = (char **) chk_malloc((nargs + 1) * sizeof *argv); + argv = (char **) chk_malloc((nargs + 2) * sizeof *argv); - for (i = 0, iter = args; iter; i++, iter = cdr(iter)) { + for (i = 0, iter = cons(name, args); iter; i++, iter = cdr(iter)) { val arg = car(iter); argv[i] = utf8_dup_to(c_str(arg)); } |