summaryrefslogtreecommitdiff
path: root/apps/filetree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/filetree.c')
-rw-r--r--apps/filetree.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index 42f13f39e7..eb429c83e3 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -287,12 +287,18 @@ static int compare(const void* p1, const void* p2)
287/* load and sort directory into the tree's cache. returns NULL on failure. */ 287/* load and sort directory into the tree's cache. returns NULL on failure. */
288int ft_load(struct tree_context* c, const char* tempdir) 288int ft_load(struct tree_context* c, const char* tempdir)
289{ 289{
290 if (c->out_of_tree > 0) /* something else is loaded */
291 return 0;
292
290 int files_in_dir = 0; 293 int files_in_dir = 0;
291 int name_buffer_used = 0; 294 int name_buffer_used = 0;
292 struct dirent *entry; 295 struct dirent *entry;
293 bool (*callback_show_item)(char *, int, struct tree_context *) = NULL; 296 bool (*callback_show_item)(char *, int, struct tree_context *) = NULL;
294 DIR *dir; 297 DIR *dir;
295 298
299 if (!c->is_browsing)
300 c->browse = NULL;
301
296 if (tempdir) 302 if (tempdir)
297 dir = opendir(tempdir); 303 dir = opendir(tempdir);
298 else 304 else
@@ -760,6 +766,7 @@ int ft_enter(struct tree_context* c)
760 } 766 }
761 } 767 }
762 } 768 }
769
763 return rc; 770 return rc;
764} 771}
765 772
@@ -802,5 +809,7 @@ int ft_exit(struct tree_context* c)
802 if (exit_func) 809 if (exit_func)
803 rc = 3; 810 rc = 3;
804 811
812 c->out_of_tree = 0;
813
805 return rc; 814 return rc;
806} 815}