aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenox7 <as@tenoware.com>2018-06-25 23:05:19 -0700
committertenox7 <as@tenoware.com>2018-06-25 23:05:19 -0700
commitc26dd4faa2c2b7642c67bbe8a61ba5b1612ce0cf (patch)
treeb256254063b38d18f8c8842f7cfbc15853a2079b
parentebf449eede07f2ddcd69efda15a69ab88f5adf9f (diff)
downloadwfm-c26dd4faa2c2b7642c67bbe8a61ba5b1612ce0cf.tar.gz
fixed asscandir stat return bug
-rw-r--r--fileio.c6
1 files 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);