2
0
Fork 0

exclude . and .. entries from stat cache dirlisting

This commit is contained in:
Thomas Porzelt 2009-03-04 19:46:30 +01:00
parent 047bb1f0bd
commit d5ec193b04
1 changed files with 6 additions and 0 deletions

View File

@ -167,6 +167,12 @@ static gpointer stat_cache_thread(gpointer data) {
while ((error = readdir_r(dirp, entry, &result)) != 0 && result != NULL) {
/* hide "." and ".." */
if (result->d_name[0] == '.' && (result->d_name[1] == '\0' ||
(result->d_name[1] == '.' && result->d_name[2] == '\0'))) {
continue;
}
sced.path = g_string_sized_new(32);
g_string_assign(sced.path, result->d_name);
if (stat(result->d_name, &sced.st) == -1) {