diff options
author | Brad King <brad.king@kitware.com> | 2015-01-23 18:19:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-23 18:19:33 (GMT) |
commit | f6308b01398fdb5095f28662be326c66806eef20 (patch) | |
tree | 0572c3b4e58aea31a42dd08e4250405cc1afcb39 | |
parent | 7ab7aa60bb88474ceb4119e79f349254910b853c (diff) | |
parent | 482c84759fb6df983d519ca2ac61e3c92c0ae7e3 (diff) | |
download | CMake-f6308b01398fdb5095f28662be326c66806eef20.zip CMake-f6308b01398fdb5095f28662be326c66806eef20.tar.gz CMake-f6308b01398fdb5095f28662be326c66806eef20.tar.bz2 |
Merge branch 'backport-kwsys-directory-check-opendir' into release
-rw-r--r-- | Source/kwsys/Directory.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx index 741bcba..7041f7b 100644 --- a/Source/kwsys/Directory.cxx +++ b/Source/kwsys/Directory.cxx @@ -239,6 +239,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 (dirent* d = readdir(dir); d; d = readdir(dir) ) { |