diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-12-30 15:09:46 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-01-06 17:46:44 (GMT) |
commit | 802a28fc5e19136b947b2f7d136de31c1d10b578 (patch) | |
tree | 1c3e13b743830a9ec2a42b49165d2536843afdfb /Source/cmSystemTools.cxx | |
parent | dc08199848c20c7f76a68dbf54a85c736809ac57 (diff) | |
download | CMake-802a28fc5e19136b947b2f7d136de31c1d10b578.zip CMake-802a28fc5e19136b947b2f7d136de31c1d10b578.tar.gz CMake-802a28fc5e19136b947b2f7d136de31c1d10b578.tar.bz2 |
Add cmHasLiteralSuffix API.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 13 |
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"); } |