Permalink
Browse files

Fix skip *nix hidden files

Fixed an issue with previous commit that stopped loading files upon first encounter of hidden file
  • Loading branch information...
AnalogMan151 committed Jul 24, 2018
1 parent 489a909 commit 6280d017518daaa6bbf1df935b58ff7ab79d4649
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/fs.c
View
@@ -100,17 +100,21 @@ size_t enumerateDir(char ***output, char *path, char *pattern) {
strcpy(pathb, path);
pathb[pathlen] = '/';
int i; for (i = 0; (fno.fname[0] != 0 && fno.fname[0] != '.') && fr == FR_OK; i++) {
int i = 0;
while (fno.fname[0] != 0 && fr == FR_OK) {
if (fno.fname[0] == '.') goto end;
out = (char **)realloc(out, (i+1) * sizeof(char *));
out[i] = (char *)malloc(FF_LFN_BUF);
strcpy(out[i], pathb);
strcat(out[i], fno.fname);
pathb[pathlen+1] = 0;
i++;
end:
f_findnext(&dp, &fno);
}
end:
f_closedir(&dp);
*output = out;
return i;
}
}

0 comments on commit 6280d01

Please sign in to comment.