summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-03-22 13:36:40 (GMT)
committerBrad King <brad.king@kitware.com>2005-03-22 13:36:40 (GMT)
commit289429cd006f5a2c2e9f4d5ae590b3bf7b5598b6 (patch)
treeb24b352a577b4a44268d2e4c563dcf383c05860d /Source/cmAddCustomCommandCommand.cxx
parente0fab29395a7798c53a1e12a2aa7a246ed98b036 (diff)
downloadCMake-289429cd006f5a2c2e9f4d5ae590b3bf7b5598b6.zip
CMake-289429cd006f5a2c2e9f4d5ae590b3bf7b5598b6.tar.gz
CMake-289429cd006f5a2c2e9f4d5ae590b3bf7b5598b6.tar.bz2
ENH: Added check for invalid characters in output name.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index ac1f4eb..138d96f 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -171,6 +171,16 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args
return false;
}
+ std::string::size_type pos = output.find_first_of("#<>");
+ if(pos != output.npos)
+ {
+ cmOStringStream msg;
+ msg << "called with OUTPUT containing a \"" << output[pos]
+ << "\". This character is not allowed.";
+ this->SetError(msg.str().c_str());
+ return false;
+ }
+
// Choose which mode of the command to use.
if(source.empty() && output.empty())
{