summaryrefslogtreecommitdiffstats
path: root/Source/cmEndWhileCommand.cxx
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2012-03-01 18:32:38 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2012-03-01 20:20:48 (GMT)
commitf605b92dec414311936ff62afb0ab7847f08974e (patch)
treef86f38454378948fda2e44d4e44f6efda816fc72 /Source/cmEndWhileCommand.cxx
parent3d8028841d6a257d0bd33b71518ae8800a716ffb (diff)
downloadCMake-f605b92dec414311936ff62afb0ab7847f08974e.zip
CMake-f605b92dec414311936ff62afb0ab7847f08974e.tar.gz
CMake-f605b92dec414311936ff62afb0ab7847f08974e.tar.bz2
improve error message on a stray "endwhile()"
Diffstat (limited to 'Source/cmEndWhileCommand.cxx')
-rw-r--r--Source/cmEndWhileCommand.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmEndWhileCommand.cxx b/Source/cmEndWhileCommand.cxx
index bb4d40a..abb9e5e 100644
--- a/Source/cmEndWhileCommand.cxx
+++ b/Source/cmEndWhileCommand.cxx
@@ -12,12 +12,21 @@
#include "cmEndWhileCommand.h"
bool cmEndWhileCommand
-::InvokeInitialPass(std::vector<cmListFileArgument> const&,
+::InvokeInitialPass(std::vector<cmListFileArgument> const& args,
cmExecutionStatus &)
{
- this->SetError("An ENDWHILE command was found outside of a proper "
- "WHILE ENDWHILE structure. Or its arguments did not "
- "match the opening WHILE command.");
+ if (args.empty())
+ {
+ this->SetError("An ENDWHILE command was found outside of a proper "
+ "WHILE ENDWHILE structure.");
+ }
+ else
+ {
+ this->SetError("An ENDWHILE command was found outside of a proper "
+ "WHILE ENDWHILE structure. Or its arguments did not "
+ "match the opening WHILE command.");
+ }
+
return false;
}