diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2021-08-09 18:48:24 (GMT) |
---|---|---|
committer | Alex Turbov <i.zaufi@gmail.com> | 2021-08-09 19:35:11 (GMT) |
commit | e97e714f0d59809fcefdc94feaadedb319d252c6 (patch) | |
tree | 5129b65091504c190f086bcdec671a796758baf3 /Source/cmWhileCommand.cxx | |
parent | 880ca66b51551d5ee732c7b81349c1a5f724d093 (diff) | |
download | CMake-e97e714f0d59809fcefdc94feaadedb319d252c6.zip CMake-e97e714f0d59809fcefdc94feaadedb319d252c6.tar.gz CMake-e97e714f0d59809fcefdc94feaadedb319d252c6.tar.bz2 |
Fix: `while()` reports an error the same way as `if()`
With arguments list expanded.
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r-- | Source/cmWhileCommand.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 1363386..8938663 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -16,6 +16,7 @@ #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" +#include "cmOutputConverter.h" #include "cmSystemTools.h" #include "cmake.h" @@ -100,16 +101,13 @@ bool cmWhileFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, } if (!isTrue && !errorString.empty()) { - std::string err = "had incorrect arguments: "; - for (cmListFileArgument const& arg : this->Args) { - err += (arg.Delim ? "\"" : ""); - err += arg.Value; - err += (arg.Delim ? "\"" : ""); + std::string err = "had incorrect arguments:\n "; + for (cmExpandedCommandArgument const& i : expandedArguments) { err += " "; + err += cmOutputConverter::EscapeForCMake(i.GetValue()); } - err += "("; + err += "\n"; err += errorString; - err += ")."; mf.GetCMakeInstance()->IssueMessage(messageType, err, whileBT); if (messageType == MessageType::FATAL_ERROR) { cmSystemTools::SetFatalErrorOccured(); |