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, 7 insertions, 2 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index a46ffbb2bc..324266e64f 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -184,11 +184,16 @@ static int compare(const void* p1, const void* p2)
184} 184}
185 185
186/* load and sort directory into dircache. returns NULL on failure. */ 186/* load and sort directory into dircache. returns NULL on failure. */
187int ft_load(struct tree_context* c) 187int ft_load(struct tree_context* c, const char* tempdir)
188{ 188{
189 int i; 189 int i;
190 int name_buffer_used = 0; 190 int name_buffer_used = 0;
191 DIR *dir = opendir(c->currdir); 191 DIR *dir;
192
193 if (tempdir)
194 dir = opendir(tempdir);
195 else
196 dir = opendir(c->currdir);
192 if(!dir) 197 if(!dir)
193 return -1; /* not a directory */ 198 return -1; /* not a directory */
194 199