From e87ed76ef73d51d19330a13c71ec6fc581d86bd7 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Fri, 2 Aug 2019 19:25:25 +1200 Subject: [PATCH] Fix quoting on external Windows commands --- src/commands/classified.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/commands/classified.rs b/src/commands/classified.rs index 47c7d1fc6..7963fb823 100644 --- a/src/commands/classified.rs +++ b/src/commands/classified.rs @@ -239,7 +239,14 @@ impl ExternalCommand { } } else { for arg in &self.args { - process = process.arg(arg.item.clone()); + let arg_chars: Vec<_> = arg.chars().collect(); + if arg_chars.len() > 1 && arg_chars[0] == '"' && arg_chars[arg_chars.len() - 1] == '"' { + // quoted string + let new_arg: String = arg_chars[1..arg_chars.len() - 1].iter().collect(); + process = process.arg(new_arg); + } else { + process = process.arg(arg.item.clone()); + } } } }