diff --git a/file.c b/file.c index 8ccbc1c41c..770b338585 100644 --- a/file.c +++ b/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); diff --git a/general.h b/general.h index 163c40457e..a2ebce9f9c 100644 --- a/general.h +++ b/general.h @@ -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; diff --git a/retroarch.c b/retroarch.c index e1420ae603..a16825b51d 100644 --- a/retroarch.c +++ b/retroarch.c @@ -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; }