summaryrefslogtreecommitdiffstats
path: root/apps/tree.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-07-25 16:40:35 +0000
committerThomas Martitz <kugel@rockbox.org>2010-07-25 16:40:35 +0000
commit9ecfcb06abeec452d403b5b2285614614c6a6662 (patch)
treec41835352758690e6331c5d4fcfc7141559b7021 /apps/tree.c
parentd4b5922d3a8b9d694270c6ff06076568feb1d1fe (diff)
downloadrockbox-9ecfcb06abeec452d403b5b2285614614c6a6662.tar.gz
rockbox-9ecfcb06abeec452d403b5b2285614614c6a6662.tar.bz2
rockbox-9ecfcb06abeec452d403b5b2285614614c6a6662.zip
A bit more cleanup in rockbox_browse().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27555 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 8889b160e8..c248631744 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -923,7 +923,7 @@ int rockbox_browse(const char *root, int dirfilter)
static struct tree_context backup;
char current[MAX_PATH];
int last_context;
- const char *dir, *ext, *setting;
+ const char *dir, *ext, *setting = NULL;
backup = tc;
tc.selected_item = 0;
@@ -979,19 +979,12 @@ int rockbox_browse(const char *root, int dirfilter)
setting = global_settings.fmr_file;
break;
#endif
- default:
- dir = ext = setting = NULL;
- break;
}
- if (setting)
- snprintf(current, sizeof(current), "%s/%s.%s", dir, setting, ext);
- else /* reset current, the next call might use the old value */
- current[0] = '\0';
-
/* If we've found a file to center on, do it */
- if (current[0] == '/')
+ if (setting)
{
+ snprintf(current, sizeof(current), "%s/%s.%s", dir, setting, ext);
set_current_file(current);
/* set_current_file changes dirlevel, change it back */
tc.dirlevel = 0;