fix search rom extension oversight (#2891)

Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
This commit is contained in:
AltoXorg 2023-05-18 10:22:57 +08:00 committed by GitHub
parent b361d5ede1
commit 30cc61abce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -222,9 +222,9 @@ void Extractor::GetRoms(std::vector<std::string>& roms) {
if (S_ISREG(path.st_mode)) {
// Get the position of the extension character.
char* ext = strchr(dir->d_name, '.');
if (ext != NULL && (strcmp(ext, ".z64") == 0) && (strcmp(ext, ".n64") == 0) &&
(strcmp(ext, ".v64") == 0)) {
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);
}
}