From b409f93240dfde9891435869c64a6f879790d3bd Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sun, 3 Jul 2016 09:39:52 +0200 Subject: [PATCH] No need to count all 150 or so entries, 3 is enough --- simgear/misc/sg_dir.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simgear/misc/sg_dir.cxx b/simgear/misc/sg_dir.cxx index 8323e3f9..18a018ed 100644 --- a/simgear/misc/sg_dir.cxx +++ b/simgear/misc/sg_dir.cxx @@ -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 -- 2.39.5