summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-30 15:09:46 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-01-06 17:46:44 (GMT)
commit802a28fc5e19136b947b2f7d136de31c1d10b578 (patch)
tree1c3e13b743830a9ec2a42b49165d2536843afdfb /Source/cmSystemTools.cxx
parentdc08199848c20c7f76a68dbf54a85c736809ac57 (diff)
downloadCMake-802a28fc5e19136b947b2f7d136de31c1d10b578.zip
CMake-802a28fc5e19136b947b2f7d136de31c1d10b578.tar.gz
CMake-802a28fc5e19136b947b2f7d136de31c1d10b578.tar.bz2
Add cmHasLiteralSuffix API.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index b8163c8..1de2358 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -359,18 +359,11 @@ bool cmSystemTools::IsOn(const char* val)
bool cmSystemTools::IsNOTFOUND(const char* val)
{
- size_t len = strlen(val);
- const char* notfound = "-NOTFOUND";
- const size_t lenNotFound = 9;
- if(len < lenNotFound-1)
+ if(strcmp(val, "NOTFOUND") == 0)
{
- return false;
- }
- if(len == lenNotFound-1)
- {
- return ( strcmp(val, "NOTFOUND") == 0);
+ return true;
}
- return ((strncmp((val + (len - lenNotFound)), notfound, lenNotFound) == 0));
+ return cmHasLiteralSuffix(val, "-NOTFOUND");
}