diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | stream.c | 5 |
2 files changed, 16 insertions, 1 deletions
@@ -1,5 +1,17 @@ 2014-03-16 Kaz Kylheku <kaz@kylheku.com> + * stream.c (win_make_cmdline): I think I cracked the code of + passing escaped arguments to Microsoft's popen and system + functions. The first argument cannot be quoted, but the + subsequent ones can. It is the quoting of the first argument + that causes the whole thing to be quoted. So we just + avoid quoting the first argument. (If it has spaces, too bad; + don't do that). + (open_process): Fix neglected optional argument handling + in Windows version of this function. + +2014-03-16 Kaz Kylheku <kaz@kylheku.com> + * configure: Detect _wspawn* functions. * stream.c (run): Implement using _wspawnvp on MinGW. @@ -2252,6 +2252,9 @@ static val win_make_cmdline(val args) { val out = string(L""); + string_extend(out, pop(&args)); + string_extend(out, lit(" ")); + for (; args; args = cdr(args)) { string_extend(out, lit("\"")); string_extend(out, win_escape_arg(car(args))); @@ -2266,7 +2269,7 @@ static val win_make_cmdline(val args) val open_process(val name, val mode_str, val args) { - val win_cmdline = win_make_cmdline(cons(name, args)); + val win_cmdline = win_make_cmdline(cons(name, default_bool_arg(args))); return open_command(win_cmdline, mode_str); } #endif |