summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-24 12:38:51 (GMT)
committerBrad King <brad.king@kitware.com>2015-01-24 12:38:51 (GMT)
commit391748d57e090c53f6c55ea265e038fde1bca032 (patch)
tree69ff1a06567a074d3a0e507e6cce754b7d99b5b0 /Source/kwsys
parent97502ba77b6d589e2ff48a22b703f6908d5b5fdc (diff)
parent0b9aad7568bc5f1cf56e01fe2b3dc57f5dff5133 (diff)
downloadCMake-391748d57e090c53f6c55ea265e038fde1bca032.zip
CMake-391748d57e090c53f6c55ea265e038fde1bca032.tar.gz
CMake-391748d57e090c53f6c55ea265e038fde1bca032.tar.bz2
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/Directory.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx
index 04b2866..58cea63 100644
--- a/Source/kwsys/Directory.cxx
+++ b/Source/kwsys/Directory.cxx
@@ -244,6 +244,11 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
{
DIR* dir = opendir(name.c_str());
+ if (!dir)
+ {
+ return 0;
+ }
+
unsigned long count = 0;
for (kwsys_dirent* d = readdir(dir); d; d = readdir(dir) )
{