summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2005-01-18 22:59:29 +0000
committerBjörn Stenberg <bjorn@haxx.se>2005-01-18 22:59:29 +0000
commitea1188ce8c7053e191dd665c4036df849e19d2fe (patch)
tree2003c8f65f31478eebbdb0b15794c7c09d92644f /apps
parentcdd79a35d40b314a723752cd40eb03ece79620b9 (diff)
downloadrockbox-ea1188ce8c7053e191dd665c4036df849e19d2fe.tar.gz
rockbox-ea1188ce8c7053e191dd665c4036df849e19d2fe.tar.bz2
rockbox-ea1188ce8c7053e191dd665c4036df849e19d2fe.zip
Repaired broken exit from plugin/font/language browser
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5597 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/tree.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/apps/tree.c b/apps/tree.c
index e4c6110040..06aabb7d36 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -749,6 +749,11 @@ static bool dirbrowse(void)
#ifdef TREE_RC_EXIT
case TREE_RC_EXIT:
#endif
+ if (*tc.dirfilter > NUM_FILTER_MODES && tc.dirlevel < 1) {
+ exit_func = true;
+ break;
+ }
+
if (!tc.dirlevel)
break;
@@ -1363,31 +1368,18 @@ bool create_playlist(void)
bool rockbox_browse(const char *root, int dirfilter)
{
- bool rc;
- int dircursor_save = tc.dircursor;
- int dirstart_save = tc.dirstart;
- int dirlevel_save = tc.dirlevel;
- int dirpos_save = tc.dirpos[0];
- int cursorpos_save = tc.cursorpos[0];
- int* dirfilter_save = tc.dirfilter;
- static char currdir_save[MAX_PATH];
-
- memcpy(currdir_save, tc.currdir, sizeof(tc.currdir));
+ static struct tree_context backup;
+
+ backup = tc;
reload_dir = true;
memcpy(tc.currdir, root, sizeof(tc.currdir));
start_wps = false;
tc.dirfilter = &dirfilter;
- rc = dirbrowse();
+ dirbrowse();
- memcpy(tc.currdir, currdir_save, sizeof(tc.currdir));
+ tc = backup;
reload_dir = true;
- tc.dirstart = dirstart_save;
- tc.cursorpos[0] = cursorpos_save;
- tc.dirlevel = dirlevel_save;
- tc.dircursor = dircursor_save;
- tc.dirpos[0] = dirpos_save;
- tc.dirfilter = dirfilter_save;
return false;
}