From f96bf79f8ee04fe19b68cb026b235ca3baa8421a Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 19 Feb 2008 18:40:37 -0800 Subject: [PATCH] Fix MENU TITLE -> MENU LABEL inheritance Correctly make it so MENU TITLE can be inherited upward as MENU TITLE unless one is provided. --- com32/menu/readconfig.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c index 7efee91..a17beb2 100644 --- a/com32/menu/readconfig.c +++ b/com32/menu/readconfig.c @@ -119,7 +119,7 @@ static struct menu * new_menu(struct menu *parent, struct menu *m = calloc(1, sizeof(struct menu)); int i; - m->label = refstrdup(label); + m->label = label; m->title = refstr_get(empty_string); if (parent) { @@ -347,7 +347,7 @@ static struct menu *begin_submenu(const char *tag) me = new_entry(current_menu); me->displayname = refstrdup(tag); - return new_menu(current_menu, me, tag); + return new_menu(current_menu, me, refstr_get(me->displayname)); } static struct menu *end_submenu(void) @@ -583,7 +583,7 @@ static void parse_config_file(FILE *f) m->title = refstrdup(skipspace(p+5)); if (m->parent_entry) { /* MENU TITLE -> MENU LABEL on submenu */ - if (m->parent_entry->displayname == m->parent_entry->label) { + if (m->parent_entry->displayname == m->label) { refstr_put(m->parent_entry->displayname); m->parent_entry->displayname = refstr_get(m->title); } @@ -905,8 +905,8 @@ void parse_configs(char **argv) empty_string = refstrdup(""); /* Initialize defaults for the root and hidden menus */ - hide_menu = new_menu(NULL, NULL, ".hidden"); - root_menu = new_menu(NULL, NULL, ".top"); + hide_menu = new_menu(NULL, NULL, refstrdup(".hidden")); + root_menu = new_menu(NULL, NULL, refstrdup(".top")); start_menu = root_menu; /* Other initialization */ -- 2.7.4