forked from len0rd/rockbox
A bit more cleanup in rockbox_browse().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27555 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d4b5922d3a
commit
9ecfcb06ab
1 changed files with 3 additions and 10 deletions
13
apps/tree.c
13
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue