Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
9351fe4f
Commit
9351fe4f
authored
Oct 12, 2021
by
longpanda
Browse files
Fix a bug that menu_tip is not shown for the default menu item.
parent
67b8a34e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c
GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c
+19
-12
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c
View file @
9351fe4f
...
@@ -389,23 +389,29 @@ int g_ventoy_tip_label_enable = 0;
...
@@ -389,23 +389,29 @@ int g_ventoy_tip_label_enable = 0;
const
char
*
g_ventoy_tip_msg1
=
NULL
;
const
char
*
g_ventoy_tip_msg1
=
NULL
;
const
char
*
g_ventoy_tip_msg2
=
NULL
;
const
char
*
g_ventoy_tip_msg2
=
NULL
;
static
void
static
void
menu_set_chosen_tip
(
grub_menu_t
menu
,
int
entry
)
menu_set_chosen_entry
(
grub_menu_t
menu
,
int
entry
)
{
{
struct
grub_menu_viewer
*
cur
;
img_info
*
img
;
img_info
*
img
;
grub_menu_entry_t
e
=
grub_menu_get_entry
(
menu
,
entry
);
grub_menu_entry_t
e
=
grub_menu_get_entry
(
menu
,
entry
);
g_ventoy_tip_msg1
=
g_ventoy_tip_msg2
=
NULL
;
g_ventoy_tip_msg1
=
g_ventoy_tip_msg2
=
NULL
;
if
(
e
&&
e
->
id
&&
grub_strncmp
(
e
->
id
,
"VID_"
,
4
)
==
0
)
{
if
(
e
&&
e
->
id
&&
grub_strncmp
(
e
->
id
,
"VID_"
,
4
)
==
0
)
img
=
(
img_info
*
)(
void
*
)
grub_strtoul
(
e
->
id
+
4
,
NULL
,
16
);
if
(
img
)
{
{
g_ventoy_tip_msg1
=
img
->
tip1
;
img
=
(
img_info
*
)(
void
*
)
grub_strtoul
(
e
->
id
+
4
,
NULL
,
16
);
g_ventoy_tip_msg2
=
img
->
tip2
;
if
(
img
)
{
g_ventoy_tip_msg1
=
img
->
tip1
;
g_ventoy_tip_msg2
=
img
->
tip2
;
}
}
}
}
}
static
void
menu_set_chosen_entry
(
grub_menu_t
menu
,
int
entry
)
{
struct
grub_menu_viewer
*
cur
;
menu_set_chosen_tip
(
menu
,
entry
);
for
(
cur
=
viewers
;
cur
;
cur
=
cur
->
next
)
for
(
cur
=
viewers
;
cur
;
cur
=
cur
->
next
)
cur
->
set_chosen_entry
(
entry
,
cur
->
data
);
cur
->
set_chosen_entry
(
entry
,
cur
->
data
);
}
}
...
@@ -701,6 +707,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
...
@@ -701,6 +707,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
current_entry
=
default_entry
;
current_entry
=
default_entry
;
refresh:
refresh:
menu_set_chosen_tip
(
menu
,
current_entry
);
menu_init
(
current_entry
,
menu
,
nested
);
menu_init
(
current_entry
,
menu
,
nested
);
/* Initialize the time. */
/* Initialize the time. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment