diff --git a/src/filemanager/find.c b/src/filemanager/find.c index f43885075..f7f33ce6b 100644 --- a/src/filemanager/find.c +++ b/src/filemanager/find.c @@ -1754,6 +1754,7 @@ do_find (const char *start_dir, ssize_t start_dir_len, const char *ignore_dirs, dir_list *list = ¤t_panel->dir; char *name = NULL; + panel_clean_dir (current_panel); dir_list_init (list); for (i = 0, entry = listbox_get_first_link (find_list); entry != NULL; @@ -1803,8 +1804,6 @@ do_find (const char *start_dir, ssize_t start_dir_len, const char *ignore_dirs, continue; } - if (list->len == 0) /* first turn i.e clean old list */ - panel_clean_dir (current_panel); list->list[list->len].fnamelen = strlen (p); list->list[list->len].fname = g_strndup (p, list->list[list->len].fnamelen); list->list[list->len].f.marked = 0; @@ -1820,21 +1819,18 @@ do_find (const char *start_dir, ssize_t start_dir_len, const char *ignore_dirs, rotate_dash (TRUE); } - if (list->len != 0) - { - current_panel->is_panelized = TRUE; + current_panel->is_panelized = TRUE; - /* absolute path */ - if (start_dir_len < 0) - { - int ret; - vfs_path_free (current_panel->cwd_vpath); - current_panel->cwd_vpath = vfs_path_from_str (PATH_SEP_STR); - ret = chdir (PATH_SEP_STR); - (void) ret; - } - panelize_save_panel (current_panel); + /* absolute path */ + if (start_dir_len < 0) + { + int ret; + vfs_path_free (current_panel->cwd_vpath); + current_panel->cwd_vpath = vfs_path_from_str (PATH_SEP_STR); + ret = chdir (PATH_SEP_STR); + (void) ret; } + panelize_save_panel (current_panel); } g_free (content_pattern); diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c index 118f7ef7f..336825665 100644 --- a/src/filemanager/panelize.c +++ b/src/filemanager/panelize.c @@ -356,9 +356,7 @@ do_external_panelize (char *command) current_panel->is_panelized = TRUE; - if (list->len == 0) - dir_list_init (list); - else if (list->len > 1 && IS_PATH_SEP (list->list[1].fname[0])) + if (list->len > 1 && IS_PATH_SEP (list->list[1].fname[0])) { vfs_path_t *vpath_root; int ret;