Skip any that that starts with '.' it's ether a relative link or a hidden file on nix and should not be iterated.

This commit is contained in:
Jeffery Myers 2020-12-16 16:01:18 -08:00
parent 0987507ef5
commit 21d0278887

View File

@ -2420,10 +2420,13 @@ char **GetDirectoryFiles(const char *dirPath, int *fileCount)
// That way we can allocate required memory, instead of a limited pool // That way we can allocate required memory, instead of a limited pool
while ((entity = readdir(dir)) != NULL) while ((entity = readdir(dir)) != NULL)
{
if (entity->d_name != NULL && entity->d_name[0] != '.')
{ {
strcpy(dirFilesPath[counter], entity->d_name); strcpy(dirFilesPath[counter], entity->d_name);
counter++; counter++;
} }
}
closedir(dir); closedir(dir);
} }