mirror of https://github.com/snes9xgit/snes9x.git
Use splitpath in CheckForAnyPatch (fixes extensions != 3 characters)
This commit is contained in:
parent
eaaf1ad779
commit
c654caed32
11
memmap.cpp
11
memmap.cpp
|
@ -3807,15 +3807,10 @@ void CMemory::CheckForAnyPatch(const char *rom_filename, bool8 header, int32 &ro
|
||||||
int ret;
|
int ret;
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
|
|
||||||
int rom_filename_length = strlen(rom_filename);
|
auto path = splitpath(rom_filename);
|
||||||
const char *ext = NULL;
|
|
||||||
if (rom_filename_length < 4)
|
|
||||||
return;
|
|
||||||
if (rom_filename[rom_filename_length - 4] == '.')
|
|
||||||
ext = &rom_filename[rom_filename_length - 3];
|
|
||||||
|
|
||||||
#ifdef UNZIP_SUPPORT
|
#ifdef UNZIP_SUPPORT
|
||||||
if (!strcasecmp(ext, "zip") || !strcasecmp(ext, ".zip"))
|
if (path.ext_is(".zip"))
|
||||||
{
|
{
|
||||||
unzFile file = unzOpen(rom_filename);
|
unzFile file = unzOpen(rom_filename);
|
||||||
if (file)
|
if (file)
|
||||||
|
@ -3872,7 +3867,7 @@ void CMemory::CheckForAnyPatch(const char *rom_filename, bool8 header, int32 &ro
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mercurial Magic (MSU-1 distribution pack)
|
// Mercurial Magic (MSU-1 distribution pack)
|
||||||
if (strcasecmp(ext, "msu1") && strcasecmp(ext, ".msu1")) // ROM was *NOT* loaded from a .msu1 pack
|
if (path.ext_is(".msu1")) // ROM was *NOT* loaded from a .msu1 pack
|
||||||
{
|
{
|
||||||
Stream *s = S9xMSU1OpenFile("patch.bps", TRUE);
|
Stream *s = S9xMSU1OpenFile("patch.bps", TRUE);
|
||||||
if (s)
|
if (s)
|
||||||
|
|
Loading…
Reference in New Issue