summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmMakefile.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bfe46ae..1e995fb 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3362,7 +3362,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty()) {
const char* currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE");
std::string mods = cmSystemTools::GetCMakeRoot() + "/Modules/";
- if (currentFile && strncmp(currentFile, mods.c_str(), mods.size()) == 0) {
+ if (currentFile && cmSystemTools::IsSubDirectory(currentFile, mods)) {
switch (this->GetPolicyStatus(cmPolicies::CMP0017)) {
case cmPolicies::WARN: {
std::ostringstream e;