Browse Source

KWSys 2015-01-23 (d4e7f08e)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ d4e7f08e | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' b33e7b96..d4e7f08e
Brad King (1):
      d4e7f08e Directory: Check opendir return value before using it

Change-Id: I3485ec9c7ad3b7f25df610d4d1898c5150a995f0
KWSys Robot 10 years ago
parent
commit
0b9aad7568
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Directory.cxx

+ 5 - 0
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) )
     {