From 786de4f0f1c1f951797940faff8328513d7df0ef Mon Sep 17 00:00:00 2001 From: Arthur Roberts Date: Wed, 7 Jun 2023 22:51:33 +0100 Subject: [PATCH] Correcting escaping Still not 100% sure it's good --- src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 603cb2e..40ad9d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,11 +139,9 @@ impl RustDoomLauncher { Ok((launch, comms)) => { let mut command_string = String::new(); // Feels like a bit of a hack, but it works I think - command_string.push_str(&Cow::from(launch).to_string()); + command_string.push_str(&format!(" '{}'", launch)); for c in comms { - command_string.push_str(" \'"); - command_string.push_str(c); - command_string.push('\'') + command_string.push_str(&format!(" '{}'", c)); } command_string }