only check for ".." filepath once

This commit is contained in:
Cray Elliott
2019-08-01 16:27:17 -07:00
parent 6e5e238cc6
commit 3fe86a76b1

View File

@@ -1063,12 +1063,15 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons
if (options & SCANO_NEOGEO)
{
if (de->d_type != DT_DIR) continue;
// skip hidden folders
if (!strncasecmp(de->d_name, ".", 1) && strcmp(de->d_name, "..")) continue;
if (!strcmp(de->d_name, ".."))
{
if (!strlen(path)) continue;
}
else
{
// skip hidden folders
if (!strncasecmp(de->d_name, ".", 1)) continue;
}
direntext_t dext = { *de, 0, "" };
memcpy(dext.altname, de->d_name, sizeof(dext.altname));
@@ -1087,14 +1090,17 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons
{
if (de->d_type == DT_DIR)
{
// skip hidden folder
if (!strncasecmp(de->d_name, ".", 1) && strcmp(de->d_name, "..")) continue;
// skip System Volume Information folder
if (!strcmp(de->d_name, "System Volume Information")) continue;
if (!strcmp(de->d_name, ".."))
{
if (!strlen(path)) continue;
}
else
{
// skip hidden folder
if (!strncasecmp(de->d_name, ".", 1)) continue;
}
if (!(options & SCANO_DIR))
{