From 3b801603d5d071af1f3610171ca264cd891a7098 Mon Sep 17 00:00:00 2001 From: marco_g Date: Mon, 5 Mar 2007 20:32:43 +0000 Subject: [PATCH] 2007-03-05 Marco Gerards * normal/main.c (read_config_file): When "menu" is not set, create an initial context. --- ChangeLog | 5 +++++ normal/main.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33623b836..1ae27ca8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-05 Marco Gerards + + * normal/main.c (read_config_file): When "menu" is not set, create + an initial context. + 2007-02-21 Hollis Blanchard * kern/powerpc/ieee1275/init.c (HEAP_SIZE): Removed. diff --git a/normal/main.c b/normal/main.c index 33e1fcfe9..a4d99a0a2 100644 --- a/normal/main.c +++ b/normal/main.c @@ -217,7 +217,9 @@ read_config_file (const char *config, int nested) grub_menu_t newmenu; - if (nested) + newmenu = grub_env_get_data_slot ("menu"); + + if (nested || ! newmenu) { newmenu = grub_malloc (sizeof (*newmenu)); if (! newmenu) @@ -231,10 +233,7 @@ read_config_file (const char *config, int nested) if (! file) return 0; - if (nested) - grub_env_set_data_slot ("menu", newmenu); - else - newmenu = grub_env_get_data_slot ("menu"); + grub_env_set_data_slot ("menu", newmenu); while (1) {