diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2022-06-27 02:38:43 (GMT) |
---|---|---|
committer | Alex Turbov <i.zaufi@gmail.com> | 2022-07-11 13:14:01 (GMT) |
commit | a3fe1aca0c9720e9725cec5c934c616ceeb592b1 (patch) | |
tree | 536c99ae6265d5c5e1a92d0ea735918b2cdca2b6 | |
parent | b5f880d5c69b72dcebd41cd0e5de6a82cdd5bbb2 (diff) | |
download | CMake-a3fe1aca0c9720e9725cec5c934c616ceeb592b1.zip CMake-a3fe1aca0c9720e9725cec5c934c616ceeb592b1.tar.gz CMake-a3fe1aca0c9720e9725cec5c934c616ceeb592b1.tar.bz2 |
cmFindPackageCommand: Replace `strcmp` with array subscription
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8fcfa22..cefd380 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -5,7 +5,6 @@ #include <algorithm> #include <cassert> #include <cstdio> -#include <cstring> #include <deque> #include <functional> #include <iterator> @@ -2240,7 +2239,9 @@ bool cmFileListGeneratorBase::Consider(std::string const& fullPath, bool cmFileListGeneratorBase::IsIgnoredEntry(const char* const fname) { assert(fname != nullptr); - return strcmp(fname, ".") == 0 || strcmp(fname, "..") == 0; + assert(fname[0] != 0); + return fname[0] == '.' && + (fname[1] == 0 || (fname[1] == '.' && fname[2] == 0)); } class cmFileListGeneratorFixed : public cmFileListGeneratorBase |