summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-05-18 21:02:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-05-18 21:02:44 -0700
commit246887dce1d8d09ec2a5af5f019613ac064e779c (patch)
tree3b503e475dace16f12e88c4331813470afe26b78
parent4f010c138cfc1d58758a4550dcec513e3600dec2 (diff)
downloadtxr-246887dce1d8d09ec2a5af5f019613ac064e779c.tar.gz
txr-246887dce1d8d09ec2a5af5f019613ac064e779c.tar.bz2
txr-246887dce1d8d09ec2a5af5f019613ac064e779c.zip
* stream.c (open_pipev): Bugfix: program name is included
as first element of argv.
-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));
}