aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-19 18:34:14 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-19 18:34:14 -0800
commitc7d9ee8f4552a62962dae614d5dcb3ef7dd9ce0e (patch)
treea8830bbfef4c4347868903158d4ed8663e052d0e
parent905ba26066f92b6ad64941dbfbb0463112b35275 (diff)
downloadsyslinux-c7d9ee8f4552a62962dae614d5dcb3ef7dd9ce0e.tar.gz
syslinux-c7d9ee8f4552a62962dae614d5dcb3ef7dd9ce0e.tar.xz
syslinux-c7d9ee8f4552a62962dae614d5dcb3ef7dd9ce0e.zip
Make sure color directives get attached to the proper menu.
Color directives would always end up attached to the root menu, no matter what menu declaration they where actually located in.
-rw-r--r--com32/menu/colors.c1
-rw-r--r--com32/menu/menu.h2
-rw-r--r--com32/menu/menumain.c2
-rw-r--r--com32/menu/readconfig.c4
4 files changed, 5 insertions, 4 deletions
diff --git a/com32/menu/colors.c b/com32/menu/colors.c
index 9b1a19aa..cfd91f1d 100644
--- a/com32/menu/colors.c
+++ b/com32/menu/colors.c
@@ -62,6 +62,7 @@ static const struct color_table default_colors[] = {
#define NCOLORS (sizeof default_colors/sizeof default_colors[0])
const int message_base_color = NCOLORS;
+const int menu_color_table_size = NCOLORS+256;
/* Algorithmically generate the msgXX colors */
void set_msg_colors_global(struct color_table *tbl,
diff --git a/com32/menu/menu.h b/com32/menu/menu.h
index 5aeb48f6..b1a98a27 100644
--- a/com32/menu/menu.h
+++ b/com32/menu/menu.h
@@ -189,7 +189,7 @@ int menu_main(int argc, char *argv[]);
void console_prepare(void);
void console_cleanup(void);
-extern const int message_base_color;
+extern const int message_base_color, menu_color_table_size;
int mygetkey(clock_t timeout);
int show_message_file(const char *filename, const char *background);
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 73049867..59ba32ad 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -659,7 +659,7 @@ static void
prepare_screen_for_menu(void)
{
console_color_table = cm->color_table;
- console_color_table_size = message_base_color+256;
+ console_color_table_size = menu_color_table_size;
set_background(cm->menu_background);
}
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index 9a0697f3..7efee912 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -627,8 +627,8 @@ static void parse_config_file(FILE *f)
int i;
struct color_table *cptr;
p = skipspace(ep);
- cptr = console_color_table;
- for ( i = 0; i < console_color_table_size; i++ ) {
+ cptr = m->color_table;
+ for ( i = 0; i < menu_color_table_size; i++ ) {
if ( (ep = looking_at(p, cptr->name)) ) {
p = skipspace(ep);
if (*p) {