From 972e5d2b145d2e927f4f94c3dc36b777f9d1b650 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 6 Mar 2024 19:45:49 -0600 Subject: [PATCH] Strip quotes out of the working directory path --- src/process.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/process.cpp b/src/process.cpp index 80429157..89dc4dc5 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -664,6 +664,12 @@ namespace proc { if (working_dir) { ctx.working_dir = parse_env_val(this_env, *working_dir); +#ifdef _WIN32 + // The working directory, unlike the command itself, should not be quoted + // when it contains spaces. Unlike POSIX, Windows forbids quotes in paths, + // so we can safely strip them all out here to avoid confusing the user. + boost::erase_all(ctx.working_dir, "\""); +#endif } if (image_path) {