From afac7482d2d131a74f699f05f93cf6b17effe5d2 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 23 Oct 2020 09:12:43 -0400 Subject: cmake: command arguments which use '=' behave consistently Fixes: #21351 The `profiling-format`, `profiling-output`, and `preset` all would crash when invoked without a trailing `=`. --- Source/cmake.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2a14b03..f8dc1ed 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -941,19 +941,19 @@ void cmake::SetArgs(const std::vector& args) return; } #if !defined(CMAKE_BOOTSTRAP) - } else if (cmHasLiteralPrefix(arg, "--profiling-format")) { + } else if (cmHasLiteralPrefix(arg, "--profiling-format=")) { profilingFormat = arg.substr(strlen("--profiling-format=")); if (profilingFormat.empty()) { cmSystemTools::Error("No format specified for --profiling-format"); } - } else if (cmHasLiteralPrefix(arg, "--profiling-output")) { + } else if (cmHasLiteralPrefix(arg, "--profiling-output=")) { profilingOutput = arg.substr(strlen("--profiling-output=")); profilingOutput = cmSystemTools::CollapseFullPath(profilingOutput); cmSystemTools::ConvertToUnixSlashes(profilingOutput); if (profilingOutput.empty()) { cmSystemTools::Error("No path specified for --profiling-output"); } - } else if (cmHasLiteralPrefix(arg, "--preset")) { + } else if (cmHasLiteralPrefix(arg, "--preset=")) { presetName = arg.substr(strlen("--preset=")); if (presetName.empty()) { cmSystemTools::Error("No preset specified for --preset"); -- cgit v0.12