Permalink
Browse files

Merge pull request #6 from AnalogMan151/master

Skip *nix hidden files
  • Loading branch information...
Reisyukaku committed Jul 24, 2018
2 parents bccfa69 + 6280d01 commit 11e1cfce6b9edc7e1058c41b691c246f66c0bdd1
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 && 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 11e1cfc

Please sign in to comment.