From 488e0d10ea66171f029cbc860499b59ea03fdf08 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 28 Sep 2013 02:40:24 +0200 Subject: [PATCH] (RMenu) Properly goes back now a prev dir for select_directory/select_file --- frontend/menu/rmenu.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index 55e4d52e5e..7a5d3e178a 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -798,7 +798,13 @@ static int select_file(void *data, uint64_t action) } break; case RGUI_ACTION_CANCEL: - pop_menu_stack = true; + { + char tmp_str[PATH_MAX]; + fill_pathname_parent_dir(tmp_str, rgui->browser->current_dir.directory_path, sizeof(tmp_str)); + + if (tmp_str[0] == '\0') + pop_menu_stack = true; + } break; case RGUI_ACTION_MAPPING_PREVIOUS: if (rgui->menu_type == FILE_BROWSER_MENU) @@ -873,7 +879,13 @@ static int select_directory(void *data, uint64_t action) break; #endif case RGUI_ACTION_CANCEL: - pop_menu_stack = true; + { + char tmp_str[PATH_MAX]; + fill_pathname_parent_dir(tmp_str, rgui->browser->current_dir.directory_path, sizeof(tmp_str)); + + if (tmp_str[0] == '\0') + pop_menu_stack = true; + } break; }