From 1fb7ff7c4e279beeb2f9ef028f31034db1bc1874 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 30 May 2013 22:53:40 +0200 Subject: [PATCH] Push the correct path to history. If a zipped ROM was loaded directly from CLI, the extracted path would be pushed to history. --- frontend/menu/menu_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index a4b500a528..2ea845c254 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -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));