From 90668c9e870563b7a7aaf35103b6ef430533086f Mon Sep 17 00:00:00 2001 From: Cray Elliott Date: Tue, 30 Jul 2019 17:58:10 -0700 Subject: [PATCH] Hide hidden files from MiSTer file browser --- file_io.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/file_io.cpp b/file_io.cpp index b745d0d..d942dfa 100644 --- a/file_io.cpp +++ b/file_io.cpp @@ -1063,7 +1063,8 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons if (options & SCANO_NEOGEO) { if (de->d_type != DT_DIR) continue; - if (!strcmp(de->d_name, ".")) continue; + // skip hidden folders + if (!strncasecmp(de->d_name, ".", 1) && strcmp(de->d_name, "..")) continue; if (!strcmp(de->d_name, "..")) { if (!strlen(path)) continue; @@ -1086,7 +1087,10 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons { if (de->d_type == DT_DIR) { - if (!strcmp(de->d_name, ".")) continue; + // 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; @@ -1100,6 +1104,8 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons } else if (de->d_type == DT_REG) { + // skip hidden files + if (!strncasecmp(de->d_name, ".", 1)) continue; //skip non-selectable files if (!strcasecmp(de->d_name, "menu.rbf")) continue; if (!strncasecmp(de->d_name, "menu_20", 7)) continue;