No need to count all 150 or so entries, 3 is enough
This commit is contained in:
parent
82a9491de4
commit
98de216878
@ -280,7 +280,7 @@ bool Dir::isEmpty() const
|
|||||||
|
|
||||||
int n = 0;
|
int n = 0;
|
||||||
dirent* d;
|
dirent* d;
|
||||||
while( (d = readdir(dp)) !=NULL ) n++;
|
while( (d = readdir(dp)) !=NULL && (n < 4) ) n++;
|
||||||
closedir(dp);
|
closedir(dp);
|
||||||
|
|
||||||
return (n == 2); // '.' and '..' always exist
|
return (n == 2); // '.' and '..' always exist
|
||||||
|
Loading…
Reference in New Issue
Block a user