summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-12-10 15:49:34 (GMT)
committerBrad King <brad.king@kitware.com>2016-12-12 19:04:16 (GMT)
commit88da3d68c2d205688762fd6a7e84fd730533e844 (patch)
tree59c1b137d9e25fc2b8afb2a75eb01ffff6d00f16 /Source/CPack
parent58c66393cfb999f23bfb6ff72122ecbc531434c0 (diff)
downloadCMake-88da3d68c2d205688762fd6a7e84fd730533e844.zip
CMake-88da3d68c2d205688762fd6a7e84fd730533e844.tar.gz
CMake-88da3d68c2d205688762fd6a7e84fd730533e844.tar.bz2
clang-tidy: apply misc-suspicious-string-compare fixes
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 2c9ca63..1940953 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -597,13 +597,11 @@ bool cmCPackNSISGenerator::GetListOfSubdirectories(
{
cmsys::Directory dir;
dir.Load(topdir);
- size_t fileNum;
- for (fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum) {
- if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)), ".") &&
- strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)), "..")) {
- std::string fullPath = topdir;
- fullPath += "/";
- fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
+ for (unsigned long i = 0; i < dir.GetNumberOfFiles(); ++i) {
+ const char* fileName = dir.GetFile(i);
+ if (strcmp(fileName, ".") != 0 && strcmp(fileName, "..") != 0) {
+ std::string const fullPath =
+ std::string(topdir).append("/").append(fileName);
if (cmsys::SystemTools::FileIsDirectory(fullPath) &&
!cmsys::SystemTools::FileIsSymlink(fullPath)) {
if (!this->GetListOfSubdirectories(fullPath.c_str(), dirs)) {