mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
tree: handle trailing slashes in currdir when navigating up
Make ft_exit() ignore trailing slashes. Previously if these ended up in "currdir" then pressing the back button would just leave you in the same directory. Change-Id: Ic539e02a9860fa13ca3235beaf99bb474c66e151
This commit is contained in:
parent
856e3d548b
commit
e631fc4723
1 changed files with 5 additions and 0 deletions
|
@ -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--;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue