mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 05:01:50 -06:00
cmSystemTools: Teach MaybePrependCmdExe to always use backslashes
This commit is contained in:
@@ -802,6 +802,8 @@ cmsys::Status cmSystemTools::MaybePrependCmdExe(
|
||||
output.reserve(cmdLine.size() + 2);
|
||||
output.emplace_back(cmSystemTools::GetComspec());
|
||||
output.emplace_back("/c");
|
||||
// Convert the batch file path to use backslashes for cmd.exe to parse.
|
||||
std::replace(applicationName.begin(), applicationName.end(), '/', '\\');
|
||||
if (applicationName.find(' ') != std::string::npos) {
|
||||
// Convert the batch file path to a short path to avoid spaces.
|
||||
// Otherwise, cmd.exe may not handle arguments with spaces.
|
||||
|
||||
Reference in New Issue
Block a user