From a5281fd635209b0776cdc4ba43aed1b1dfe421dd Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 1 Apr 2025 11:26:48 +0200 Subject: [PATCH] cmCacheManager: clarify whitespace skipping Originally noticed as not comparing to `\0` (NUL), the condition is actually redundant as neither `\0` nor `0` will match the "is whitespace" check in the rest of the predicate. `NUL` is checked for in the following `if` block. --- Source/cmCacheManager.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index e0dc6e3c87..cc4498f4be 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -58,9 +58,8 @@ bool cmCacheManager::LoadCache(std::string const& path, bool internal, cmSystemTools::GetLineFromStream(fin, buffer); lineno++; realbuffer = buffer.c_str(); - while (*realbuffer != '0' && - (*realbuffer == ' ' || *realbuffer == '\t' || *realbuffer == '\r' || - *realbuffer == '\n')) { + while (*realbuffer == ' ' || *realbuffer == '\t' || *realbuffer == '\r' || + *realbuffer == '\n') { if (*realbuffer == '\n') { lineno++; }