From c26dd4faa2c2b7642c67bbe8a61ba5b1612ce0cf Mon Sep 17 00:00:00 2001 From: tenox7 Date: Mon, 25 Jun 2018 23:05:19 -0700 Subject: fixed asscandir stat return bug --- fileio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fileio.c b/fileio.c index eb8732a..18a0025 100644 --- a/fileio.c +++ b/fileio.c @@ -548,8 +548,10 @@ int asscandir(const char *dir, ASDIR **namelist, int (*compar)(const void *, con while(entry!=NULL) { if(entry->d_name[0]!='.') { snprintf(filename, sizeof(filename), "%s/%s", dir, entry->d_name); - if(stat(filename, &fileinfo)!=0) - return -1; + if(stat(filename, &fileinfo)!=0) { + entry=readdir(dirh); + continue; + } memset(&names[entries], 0, sizeof(ASDIR)); strcpy(names[entries].name, entry->d_name); -- cgit v1.2.3