summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--stream.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 464a6001..b9b8889c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/stream.c b/stream.c
index 72b819ff..7175d59a 100644
--- a/stream.c
+++ b/stream.c
@@ -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));
}