From e6e7f2cab96066b5e7f595177a59ea1461608201 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 10 Jan 2021 12:40:56 +0200 Subject: cmMakefile: Don't expand bracket arguments in --trace-expand Bracket arguments are literal and shouldn't be expanded. Fixes #21671. --- Source/cmMakefile.cxx | 2 +- Tests/RunCMake/CommandLine/trace-expand.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0e4f888..3946841 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -308,7 +308,7 @@ void cmMakefile::PrintCommandTrace( args.reserve(lff.Arguments().size()); for (cmListFileArgument const& arg : lff.Arguments()) { - if (expand) { + if (expand && arg.Delim != cmListFileArgument::Bracket) { temp = arg.Value; this->ExpandVariablesInString(temp); args.push_back(temp); diff --git a/Tests/RunCMake/CommandLine/trace-expand.cmake b/Tests/RunCMake/CommandLine/trace-expand.cmake index e69de29..24da02a 100644 --- a/Tests/RunCMake/CommandLine/trace-expand.cmake +++ b/Tests/RunCMake/CommandLine/trace-expand.cmake @@ -0,0 +1 @@ +set(a [[\B]]) -- cgit v0.12