]> git.mxchange.org Git - simgear.git/commitdiff
No need to count all 150 or so entries, 3 is enough
authorErik Hofman <erik@ehofman.com>
Sun, 3 Jul 2016 07:39:52 +0000 (09:39 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
simgear/misc/sg_dir.cxx

index 8323e3f93dec3a32ad0868dc0343801cce20f2e8..18a018edf270406c677eb867957e1324d9f658f7 100644 (file)
@@ -280,7 +280,7 @@ bool Dir::isEmpty() const
 
   int n = 0;
   dirent* d;
-  while( (d = readdir(dp)) !=NULL ) n++;
+  while( (d = readdir(dp)) !=NULL && (n < 4) ) n++;
   closedir(dp);
 
   return (n == 2); // '.' and '..' always exist