Preserve backwards-compatible argument escaping behavior for executables

This commit is contained in:
Cameron Gutman 2024-02-14 21:39:14 -06:00
parent 6ddc4b7ba3
commit 56da68c863

View File

@ -720,6 +720,13 @@ namespace platf {
// to try to find it via PATH // to try to find it via PATH
return from_utf8(raw_cmd); 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) // For regular files, the class is found using the file extension (including the dot)
lookup_string = extension; lookup_string = extension;