From 54cc610fde7cfa86848200db2f5dde6a5b11980e Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Tue, 24 Mar 2015 15:40:01 +1100 Subject: subprocess-win: handle empty arguments correctly --- osdep/subprocess-win.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'osdep/subprocess-win.c') diff --git a/osdep/subprocess-win.c b/osdep/subprocess-win.c index 211f407db1..7ea6d39cba 100644 --- a/osdep/subprocess-win.c +++ b/osdep/subprocess-win.c @@ -30,6 +30,12 @@ static void write_arg(bstr *cmdline, char *arg) { + // Empty args must be represented as an empty quoted string + if (!arg[0]) { + bstr_xappend(NULL, cmdline, bstr0("\"\"")); + return; + } + // If the string doesn't have characters that need to be escaped, it's best // to leave it alone for the sake of Windows programs that don't process // quoted args correctly. -- cgit v1.2.3