diff options
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/process.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs index c89a40d6513..d64e81c6d15 100644 --- a/src/libnative/io/process.rs +++ b/src/libnative/io/process.rs @@ -479,7 +479,10 @@ fn make_command_line(prog: &CString, args: &[CString]) -> String { return cmd; fn append_arg(cmd: &mut String, arg: &str) { - let quote = arg.chars().any(|c| c == ' ' || c == '\t'); + // If an argument has 0 characters then we need to quote it to ensure + // that it actually gets passed through on the command line or otherwise + // it will be dropped entirely when parsed on the other end. + let quote = arg.chars().any(|c| c == ' ' || c == '\t') || arg.len() == 0; if quote { cmd.push_char('"'); } |
