summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/Glob.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-18 12:51:33 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-18 12:51:33 (GMT)
commitef4d992b5483403ea63df33fef1787b2c84f9b7e (patch)
treefcbbfb350206ed3a0c88c4180d834fee85fc0f4a /Source/kwsys/Glob.cxx
parent6c4bfb6e7f4998d2a163f78bde1dd1b982947c0a (diff)
parent8fd4c19e1b39efa6912321a72ac12a1c0121264e (diff)
downloadCMake-ef4d992b5483403ea63df33fef1787b2c84f9b7e.zip
CMake-ef4d992b5483403ea63df33fef1787b2c84f9b7e.tar.gz
CMake-ef4d992b5483403ea63df33fef1787b2c84f9b7e.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream * upstream-KWSys: KWSys 2020-05-18 (146f6b36)
Diffstat (limited to 'Source/kwsys/Glob.cxx')
-rw-r--r--Source/kwsys/Glob.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index fad6ee1..5452f73 100644
--- a/Source/kwsys/Glob.cxx
+++ b/Source/kwsys/Glob.cxx
@@ -182,7 +182,15 @@ bool Glob::RecurseDirectory(std::string::size_type start,
const std::string& dir, GlobMessages* messages)
{
kwsys::Directory d;
- if (!d.Load(dir)) {
+ std::string errorMessage;
+ if (!d.Load(dir, &errorMessage)) {
+ if (messages) {
+ if (!errorMessage.empty()) {
+ messages->push_back(Message(Glob::warning,
+ "Error listing directory '" + dir +
+ "'! Reason: '" + errorMessage + "'"));
+ }
+ }
return true;
}
unsigned long cc;
@@ -278,7 +286,9 @@ void Glob::ProcessDirectory(std::string::size_type start,
// std::cout << "ProcessDirectory: " << dir << std::endl;
bool last = (start == this->Internals->Expressions.size() - 1);
if (last && this->Recurse) {
- this->RecurseDirectory(start, dir, messages);
+ if (kwsys::SystemTools::FileIsDirectory(dir)) {
+ this->RecurseDirectory(start, dir, messages);
+ }
return;
}