summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchez <Archez@users.noreply.github.com>2024-11-12 11:13:44 -0500
committerGitHub <noreply@github.com>2024-11-12 11:13:44 -0500
commit31685557d2aebb1cbf0855404d24aefcb7cb5371 (patch)
treeda5831e61570fc3f47f0cddda8f4e1e1b0d9951d
parentcf923494361c637adf0b1349a0fdee170d714d16 (diff)
Fix linux auto rom detection for built-in extractor (#842)
-rw-r--r--mm/2s2h/Extractor/Extract.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/2s2h/Extractor/Extract.cpp b/mm/2s2h/Extractor/Extract.cpp
index 1b6b23738..3da5859b2 100644
--- a/mm/2s2h/Extractor/Extract.cpp
+++ b/mm/2s2h/Extractor/Extract.cpp
@@ -215,14 +215,18 @@ void Extractor::GetRoms(std::vector<std::string>& roms) {
while ((dir = readdir(d)) != NULL) {
struct stat path;
+ auto fullPath = std::filesystem::path(mSearchPath) / dir->d_name;
+ auto fullPathString = fullPath.string();
+ const char* fullPathCStr = fullPathString.c_str();
+
// Check if current entry is not folder
- stat(dir->d_name, &path);
+ stat(fullPathCStr, &path);
if (S_ISREG(path.st_mode)) {
// Get the position of the extension character.
char* ext = strrchr(dir->d_name, '.');
if (ext != NULL && (strcmp(ext, ".z64") == 0 || strcmp(ext, ".n64") == 0 || strcmp(ext, ".v64") == 0)) {
- roms.push_back(dir->d_name);
+ roms.push_back(fullPathCStr);
}
}
}