From 56da68c8632c3395c49fdecd5731ccd4421e760b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 14 Feb 2024 21:39:14 -0600 Subject: [PATCH] Preserve backwards-compatible argument escaping behavior for executables --- src/platform/windows/misc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/platform/windows/misc.cpp b/src/platform/windows/misc.cpp index d3e98950..b53bfea5 100644 --- a/src/platform/windows/misc.cpp +++ b/src/platform/windows/misc.cpp @@ -720,6 +720,13 @@ namespace platf { // to try to find it via PATH return from_utf8(raw_cmd); } + else if (boost::iequals(extension, L".exe")) { + // If the file has an .exe extension, we will bypass the resolution here and + // directly pass the unmodified command string to CreateProcess(). The argument + // escaping rules are subtly different between CreateProcess() and ShellExecute(), + // and we want to preserve backwards compatibility with older configs. + return from_utf8(raw_cmd); + } // For regular files, the class is found using the file extension (including the dot) lookup_string = extension;