Push the correct path to history.

If a zipped ROM was loaded directly from CLI, the extracted path would
be pushed to history.
This commit is contained in:
Themaister 2013-05-30 22:53:40 +02:00
parent e8cddd9191
commit 1fb7ff7c4e

View File

@ -377,7 +377,14 @@ void menu_rom_history_push_current(void)
// Ensure we're pushing absolute path.
char tmp[PATH_MAX];
strlcpy(tmp, g_extern.fullpath, sizeof(tmp));
// We loaded a zip, and fullpath points to the extracted file.
// Look at basename instead.
if (g_extern.rom_file_temporary)
snprintf(tmp, sizeof(tmp), "%s.zip", g_extern.basename);
else
strlcpy(tmp, g_extern.fullpath, sizeof(tmp));
if (*tmp)
path_resolve_realpath(tmp, sizeof(tmp));