Commit f6308b01 authored by Brad King's avatar Brad King
Browse files

Merge branch 'backport-kwsys-directory-check-opendir' into release

parents 7ab7aa60 482c8475
...@@ -239,6 +239,11 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na ...@@ -239,6 +239,11 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
{ {
DIR* dir = opendir(name.c_str()); DIR* dir = opendir(name.c_str());
if (!dir)
{
return 0;
}
unsigned long count = 0; unsigned long count = 0;
for (dirent* d = readdir(dir); d; d = readdir(dir) ) for (dirent* d = readdir(dir); d; d = readdir(dir) )
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment