From e6de6e5f8ae96649d0bdf1a26fc135e755c6f183 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Thu, 12 Apr 2007 18:33:40 +0000 Subject: 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 --- apps/tagtree.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps/tagtree.c') 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); -- cgit v1.2.3