summaryrefslogtreecommitdiffstats
path: root/osdep/subprocess-win.c
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossymiles@gmail.com>2015-03-24 15:40:01 +1100
committerJames Ross-Gowan <rossymiles@gmail.com>2015-03-24 15:40:01 +1100
commit54cc610fde7cfa86848200db2f5dde6a5b11980e (patch)
treebb1ef95839e295206aedc9f22a7b39cdb691cf86 /osdep/subprocess-win.c
parent3f4e154ec659b1f0aa306f179e8d37eea5fe19cc (diff)
downloadmpv-54cc610fde7cfa86848200db2f5dde6a5b11980e.tar.bz2
mpv-54cc610fde7cfa86848200db2f5dde6a5b11980e.tar.xz
subprocess-win: handle empty arguments correctly
Diffstat (limited to 'osdep/subprocess-win.c')
-rw-r--r--osdep/subprocess-win.c6
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.