Drop ROM history if config_path isn't set.

Avoid loading and saving history from/to a potential broken path.
This commit is contained in:
Themaister 2013-04-29 14:12:39 +02:00
parent 6cee86c768
commit e15ba44c50
2 changed files with 10 additions and 6 deletions

View File

@ -499,11 +499,14 @@ void menu_init(void)
// TODO: Should make history path configurable.
// Possibly size as well.
char history_path[PATH_MAX];
fill_pathname_resolve_relative(history_path, g_extern.config_path,
".retroarch-history.txt", sizeof(history_path));
RARCH_LOG("[RGUI]: Opening history: %s.\n", history_path);
rgui->history = rom_history_init(history_path, 20);
if (*g_extern.config_path)
{
char history_path[PATH_MAX];
fill_pathname_resolve_relative(history_path, g_extern.config_path,
".retroarch-history.txt", sizeof(history_path));
RARCH_LOG("[RGUI]: Opening history: %s.\n", history_path);
rgui->history = rom_history_init(history_path, 20);
}
}
void menu_free(void)

View File

@ -1109,7 +1109,8 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui)
rgui_list_push(rgui->selection_buf, "Core", RGUI_SETTINGS_CORE, 0);
#endif
rgui_list_push(rgui->selection_buf, "Core Options", RGUI_SETTINGS_CORE_OPTIONS, 0);
rgui_list_push(rgui->selection_buf, "Load Game (History)", RGUI_SETTINGS_OPEN_HISTORY, 0);
if (rgui->history)
rgui_list_push(rgui->selection_buf, "Load Game (History)", RGUI_SETTINGS_OPEN_HISTORY, 0);
rgui_list_push(rgui->selection_buf, "Load Game", RGUI_SETTINGS_OPEN_FILEBROWSER, 0);
rgui_list_push(rgui->selection_buf, "Video Options", RGUI_SETTINGS_VIDEO_OPTIONS, 0);