From a3fe1aca0c9720e9725cec5c934c616ceeb592b1 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Mon, 27 Jun 2022 06:38:43 +0400 Subject: cmFindPackageCommand: Replace `strcmp` with array subscription --- Source/cmFindPackageCommand.cxx | 5 +++-- 1 file 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 #include #include -#include #include #include #include @@ -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 -- cgit v0.12