summaryrefslogtreecommitdiff
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-19 11:08:49 -0400
committerBrad King <brad.king@kitware.com>2020-10-19 11:08:49 -0400
commit0356b81525019e054be5b6edc0c0f7ca51249f54 (patch)
treef1601e00b556daae032b90b703a1be6b9d4fa87b /Source/cmFindPackageCommand.cxx
parente61d872839a84a5ab7a5e8489008ffed9b83782e (diff)
downloadcmake-0356b81525019e054be5b6edc0c0f7ca51249f54.tar.gz
find_package: Fix regression in searching root prefix
Fix the check added by commit 2ff1693066 (find_package: avoid showing files as directories when searching config files, 2020-09-30, v3.19.0-rc1~67^2) to avoid skipping the root prefix `/`. Fixes: #21324
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index c988b59701..92b1e80b8a 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1984,7 +1984,7 @@ cmFileListGeneratorBase* cmFileListGeneratorBase::SetNext(
bool cmFileListGeneratorBase::Consider(std::string const& fullPath,
cmFileList& listing)
{
- if (!cmSystemTools::FileIsDirectory(fullPath)) {
+ if (!fullPath.empty() && !cmSystemTools::FileIsDirectory(fullPath)) {
return false;
}
if (this->Next) {