diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2015-03-24 15:40:01 +1100 |
---|---|---|
committer | James Ross-Gowan <rossymiles@gmail.com> | 2015-03-24 15:40:01 +1100 |
commit | 54cc610fde7cfa86848200db2f5dde6a5b11980e (patch) | |
tree | bb1ef95839e295206aedc9f22a7b39cdb691cf86 | |
parent | 3f4e154ec659b1f0aa306f179e8d37eea5fe19cc (diff) | |
download | mpv-54cc610fde7cfa86848200db2f5dde6a5b11980e.tar.bz2 mpv-54cc610fde7cfa86848200db2f5dde6a5b11980e.tar.xz |
subprocess-win: handle empty arguments correctly
-rw-r--r-- | osdep/subprocess-win.c | 6 |
1 files changed, 6 insertions, 0 deletions
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. |