From 7556253c5300006c129e08a2022989ce5c5c6b6a Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 27 Jun 2024 14:00:03 +0900 Subject: [PATCH] example: do not scan a given resource folder recursively --- examples/Example.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/examples/Example.h b/examples/Example.h index 3dab3785..62feef12 100644 --- a/examples/Example.h +++ b/examples/Example.h @@ -89,12 +89,7 @@ struct Example } do { if (*fd.cFileName == '.' || *fd.cFileName == '$') continue; - if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - auto subpath = string(path); - subpath += '\\'; - subpath += fd.cFileName; - scandir(subpath.c_str()); - } else { + if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { auto fullpath = string(path); fullpath += '\\'; fullpath += fd.cFileName; @@ -113,12 +108,7 @@ struct Example struct dirent* entry; while ((entry = readdir(dir)) != NULL) { if (*entry->d_name == '.' || *entry->d_name == '$') continue; - if (entry->d_type == DT_DIR) { - auto subpath = string(path); - subpath += '/'; - subpath += entry->d_name; - scandir(subpath.c_str()); - } else { + if (entry->d_type != DT_DIR) { auto fullpath = string(path); fullpath += '/'; fullpath += entry->d_name;