From f3c24ace430e4e23bfbc775e6ed40f138c836367 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 4 Sep 2015 23:24:14 +0200 Subject: [PATCH] Cleanups --- menu/cbs/menu_cbs_ok.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index b2186780c4..2487b6a086 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -84,6 +84,7 @@ static int generic_action_ok_displaylist_push(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx, unsigned action_type) { + char action_path[PATH_MAX_LENGTH]; unsigned dl_type = DISPLAYLIST_GENERIC; menu_displaylist_info_t info = {0}; const char *menu_label = NULL; @@ -100,6 +101,8 @@ static int generic_action_ok_displaylist_push(const char *path, menu_list_get_last_stack(menu_list, &menu_path, &menu_label, NULL, NULL); + fill_pathname_join(action_path, menu_path, path, sizeof(action_path)); + switch (action_type) { case ACTION_OK_DL_OPEN_ARCHIVE_DETECT_CORE: @@ -285,20 +288,14 @@ static int generic_action_ok_displaylist_push(const char *path, strlcpy(menu->scratch2_buf, menu_path, sizeof(menu->scratch2_buf)); break; case ACTION_OK_DL_DIRECTORY_PUSH: - { - char cat_path[PATH_MAX_LENGTH] = {0}; - - fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path)); - - info.type = type; - info.directory_ptr = idx; - strlcpy(info.path, cat_path, sizeof(info.path)); - strlcpy(info.label, menu_label, sizeof(info.label)); - } + info.type = type; + info.directory_ptr = idx; + strlcpy(info.path, action_path, sizeof(info.path)); + strlcpy(info.label, menu_label, sizeof(info.label)); break; case ACTION_OK_DL_DATABASE_MANAGER_LIST: { - char rdb_path[PATH_MAX_LENGTH] = {0}; + char rdb_path[PATH_MAX_LENGTH]; fill_pathname_join(rdb_path, settings->content_database, path, sizeof(rdb_path)); @@ -313,7 +310,7 @@ static int generic_action_ok_displaylist_push(const char *path, break; case ACTION_OK_DL_CURSOR_MANAGER_LIST: { - char cursor_path[PATH_MAX_LENGTH] = {0}; + char cursor_path[PATH_MAX_LENGTH]; fill_pathname_join(cursor_path, settings->cursor_directory, path, sizeof(cursor_path)); @@ -605,8 +602,7 @@ static int generic_action_ok(const char *path, case ACTION_OK_LOAD_CORE: flush_char = NULL; flush_type = MENU_SETTINGS; - fill_pathname_join(settings->libretro, menu_path, path, - sizeof(settings->libretro)); + strlcpy(settings->libretro, action_path, sizeof(settings->libretro)); event_command(EVENT_CMD_LOAD_CORE); #if defined(HAVE_DYNAMIC)