mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 04:20:28 +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"))
|
if (ext && !strcasecmp(ext, "zip"))
|
||||||
{
|
{
|
||||||
g_extern.rom_file_temporary = true;
|
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))
|
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);
|
RARCH_ERR("Failed to extract ROM from zipped file: %s.\n", g_extern.fullpath);
|
||||||
|
@ -305,6 +305,7 @@ struct global
|
|||||||
bool has_multitap;
|
bool has_multitap;
|
||||||
|
|
||||||
bool rom_file_temporary;
|
bool rom_file_temporary;
|
||||||
|
char last_rom[PATH_MAX];
|
||||||
enum rarch_game_type game_type;
|
enum rarch_game_type game_type;
|
||||||
uint32_t cart_crc;
|
uint32_t cart_crc;
|
||||||
|
|
||||||
|
@ -2906,9 +2906,9 @@ void rarch_main_deinit(void)
|
|||||||
|
|
||||||
if (g_extern.rom_file_temporary)
|
if (g_extern.rom_file_temporary)
|
||||||
{
|
{
|
||||||
RARCH_LOG("Removing tempoary ROM file: %s.\n", g_extern.fullpath);
|
RARCH_LOG("Removing tempoary ROM file: %s.\n", g_extern.last_rom);
|
||||||
if (remove(g_extern.fullpath) < 0)
|
if (remove(g_extern.last_rom) < 0)
|
||||||
RARCH_ERR("Failed to remove temporary file: %s.\n", g_extern.fullpath);
|
RARCH_ERR("Failed to remove temporary file: %s.\n", g_extern.last_rom);
|
||||||
g_extern.rom_file_temporary = false;
|
g_extern.rom_file_temporary = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user