Allow mounting 0000 as FAT image (#152)

This commit is contained in:
Pk11 2022-01-11 08:16:14 -06:00 committed by GitHub
parent 94f5fd73c3
commit 5408406626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ static char path[PATH_MAX];
bool extension(const std::string_view filename, const std::vector<std::string_view> &extensions) {
for(const std::string_view &ext : extensions) {
if(filename.length() > ext.length() && strcasecmp(filename.substr(filename.length() - ext.length()).data(), ext.data()) == 0)
if(filename.length() >= ext.length() && strcasecmp(filename.substr(filename.length() - ext.length()).data(), ext.data()) == 0)
return true;
}
@ -193,7 +193,7 @@ FileOperation fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) {
if(isRegularDS && (entry->size == 512 || entry->size == 8192 || entry->size == 32768 || entry->size == 65536 || entry->size == 131072))
operations.push_back(FileOperation::restoreSaveGba);
}
if(currentDrive != Drive::fatImg && extension(entry->name, {"img", "sd", "sav", "pub", "pu1", "pu2", "pu3", "pu4", "pu5", "pu6", "pu7", "pu8", "pu9", "prv", "pr1", "pr2", "pr3", "pr4", "pr5", "pr6", "pr7", "pr8", "pr9"})) {
if(currentDrive != Drive::fatImg && extension(entry->name, {"img", "sd", "sav", "pub", "pu1", "pu2", "pu3", "pu4", "pu5", "pu6", "pu7", "pu8", "pu9", "prv", "pr1", "pr2", "pr3", "pr4", "pr5", "pr6", "pr7", "pr8", "pr9", "0000"})) {
operations.push_back(FileOperation::mountImg);
}
if(extension(entry->name, {"frf"})) {