From c1f6b041761935b95f61020a0853c76a1b4eda50 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 3 Feb 2025 09:08:08 -0500 Subject: cmSystemTools: Teach MaybePrependCmdExe to always use backslashes --- Source/cmSystemTools.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 13e3245..065c4e7 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -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. -- cgit v0.12