summaryrefslogtreecommitdiffstats
path: root/apps/filetree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/filetree.c')
-rw-r--r--apps/filetree.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index 66b5c843ca..11d562f586 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -820,6 +820,11 @@ int ft_exit(struct tree_context* c)
int rc = 0;
bool exit_func = false;
int i = strlen(c->currdir);
+
+ /* strip trailing slashes */
+ while (c->currdir[i-1] == PATH_SEPCH)
+ i--;
+
if (i>1) {
while (c->currdir[i-1]!=PATH_SEPCH)
i--;