make extension checks case-insensitive

This commit is contained in:
Arisotura 2021-04-26 15:20:28 +02:00
parent 7ab19f157d
commit 4a5d5116a1
1 changed files with 3 additions and 3 deletions

View File

@ -526,7 +526,7 @@ int Reset()
char ext[5] = {0}; int _len = strlen(ROMPath[ROMSlot_NDS]);
strncpy(ext, ROMPath[ROMSlot_NDS] + _len - 4, 4);
if(!strncmp(ext, ".nds", 4) || !strncmp(ext, ".srl", 4) || !strncmp(ext, ".dsi", 4))
if(!strnicmp(ext, ".nds", 4) || !strnicmp(ext, ".srl", 4) || !strnicmp(ext, ".dsi", 4))
{
SetupSRAMPath(0);
if (!NDS::LoadROM(ROMPath[ROMSlot_NDS], SRAMPath[ROMSlot_NDS], directboot))
@ -563,7 +563,7 @@ int Reset()
char ext[5] = {0}; int _len = strlen(ROMPath[ROMSlot_GBA]);
strncpy(ext, ROMPath[ROMSlot_GBA] + _len - 4, 4);
if(!strncmp(ext, ".gba", 4))
if(!strnicmp(ext, ".gba", 4))
{
SetupSRAMPath(1);
if (!NDS::LoadGBAROM(ROMPath[ROMSlot_GBA], SRAMPath[ROMSlot_GBA]))
@ -619,7 +619,7 @@ void GetSavestateName(int slot, char* filename, int len)
char ext[5] = {0}; int _len = strlen(ROMPath[ROMSlot_NDS]);
strncpy(ext, ROMPath[ROMSlot_NDS] + _len - 4, 4);
if(!strncmp(ext, ".nds", 4) || !strncmp(ext, ".srl", 4) || !strncmp(ext, ".dsi", 4))
if(!strnicmp(ext, ".nds", 4) || !strnicmp(ext, ".srl", 4) || !strnicmp(ext, ".dsi", 4))
rompath = ROMPath[ROMSlot_NDS];
else
rompath = SRAMPath[ROMSlot_NDS]; // If archive, construct ssname from sram file