summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2007-04-12 18:33:40 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2007-04-12 18:33:40 +0000
commite6de6e5f8ae96649d0bdf1a26fc135e755c6f183 (patch)
tree04e167f2b3874ba44e76c3b04e92b7019bed3f29 /apps
parent0569fae8ec2b7138d512aac01f2bfd09c89fdde8 (diff)
downloadrockbox-e6de6e5f8ae96649d0bdf1a26fc135e755c6f183.tar.gz
rockbox-e6de6e5f8ae96649d0bdf1a26fc135e755c6f183.zip
FS#7002 - Fix a bug in parser of tagnavi.config preventing to set first menu as the root menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13130 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/tagtree.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 040aea35d1..e9370fa443 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -793,7 +793,7 @@ static int parse_line(int n, const char *buf, void *parameters)
case var_rootmenu:
/* Only set root menu once. */
- if (root_menu)
+ if (root_menu >= 0)
break;
if (get_token_str(data, sizeof(data)) < 0)
@@ -868,9 +868,14 @@ void tagtree_init(void)
format_count = 0;
menu_count = 0;
menu = NULL;
- root_menu = 0;
+ root_menu = -1;
parse_menu(FILE_SEARCH_INSTRUCTIONS);
+ /* If no root menu is set, assume it's the first single menu
+ * we have. That shouldn't normally happen. */
+ if (root_menu < 0)
+ root_menu = 0;
+
uniqbuf = buffer_alloc(UNIQBUF_SIZE);
audio_set_track_buffer_event(tagtree_buffer_event);
audio_set_track_unbuffer_event(tagtree_unbuffer_event);