From dbeb4023a2dbe0fdf9d9a13d3ed56012363a91db Mon Sep 17 00:00:00 2001 From: longpanda Date: Mon, 14 Feb 2022 14:29:50 +0800 Subject: [PATCH] Fixed to select the 1st menu item when switching between upper and lower sub-menus. --- GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c index 34b71ef6..9f44fbd2 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c @@ -671,9 +671,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) if (g_ventoy_suppress_esc) default_entry = g_ventoy_suppress_esc_default; - else if (g_ventoy_last_entry >= 0 && g_ventoy_last_entry < menu->size) { - default_entry = g_ventoy_last_entry; - } + /* If DEFAULT_ENTRY is not within the menu entries, fall back to the first entry. */ else if (default_entry < 0 || default_entry >= menu->size)