summaryrefslogtreecommitdiffstats
path: root/Source/cmCommand.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-09-24 12:51:33 (GMT)
committerBrad King <brad.king@kitware.com>2008-09-24 12:51:33 (GMT)
commit5f57efb417bc02a0aab7be2667a3712ca8af3c64 (patch)
tree8eb810faafc0ac558dab6c1c03367bf5444f0bde /Source/cmCommand.h
parentdbd88e00c7c281991b28616fe8ac4cfe5f737ea3 (diff)
downloadCMake-5f57efb417bc02a0aab7be2667a3712ca8af3c64.zip
CMake-5f57efb417bc02a0aab7be2667a3712ca8af3c64.tar.gz
CMake-5f57efb417bc02a0aab7be2667a3712ca8af3c64.tar.bz2
BUG: Skip a command if its arguments fail to parse
If the arguments to a command fail to parse correctly due to a syntax error, the command should not be invoked. This avoids problems created by processing of commands with bad arguments. Even though the build system will not be generated, the command may affect files on disk that persist across CMake runs.
Diffstat (limited to 'Source/cmCommand.h')
-rw-r--r--Source/cmCommand.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 96699ac..ed00b78 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -64,7 +64,12 @@ public:
cmExecutionStatus &status)
{
std::vector<std::string> expandedArguments;
- this->Makefile->ExpandArguments(args, expandedArguments);
+ if(!this->Makefile->ExpandArguments(args, expandedArguments))
+ {
+ // There was an error expanding arguments. It was already
+ // reported, so we can skip this command without error.
+ return true;
+ }
return this->InitialPass(expandedArguments,status);
}