mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 22:43:41 +00:00
(Console) don't delete the wrong file on when loading a second rom after loading one in a zip file
This commit is contained in:
parent
39daa377c6
commit
6d174dcc3b
2
file.c
2
file.c
@ -652,6 +652,8 @@ bool init_rom_file(enum rarch_game_type type)
|
||||
if (ext && !strcasecmp(ext, "zip"))
|
||||
{
|
||||
g_extern.rom_file_temporary = true;
|
||||
strlcpy(g_extern.last_rom, g_extern.fullpath, sizeof(g_extern.last_rom));
|
||||
|
||||
if (!zlib_extract_first_rom(g_extern.fullpath, sizeof(g_extern.fullpath), g_extern.system.valid_extensions))
|
||||
{
|
||||
RARCH_ERR("Failed to extract ROM from zipped file: %s.\n", g_extern.fullpath);
|
||||
|
@ -305,6 +305,7 @@ struct global
|
||||
bool has_multitap;
|
||||
|
||||
bool rom_file_temporary;
|
||||
char last_rom[PATH_MAX];
|
||||
enum rarch_game_type game_type;
|
||||
uint32_t cart_crc;
|
||||
|
||||
|
@ -2906,9 +2906,9 @@ void rarch_main_deinit(void)
|
||||
|
||||
if (g_extern.rom_file_temporary)
|
||||
{
|
||||
RARCH_LOG("Removing tempoary ROM file: %s.\n", g_extern.fullpath);
|
||||
if (remove(g_extern.fullpath) < 0)
|
||||
RARCH_ERR("Failed to remove temporary file: %s.\n", g_extern.fullpath);
|
||||
RARCH_LOG("Removing tempoary ROM file: %s.\n", g_extern.last_rom);
|
||||
if (remove(g_extern.last_rom) < 0)
|
||||
RARCH_ERR("Failed to remove temporary file: %s.\n", g_extern.last_rom);
|
||||
g_extern.rom_file_temporary = false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user