1 From: Colin Watson <cjwatson@ubuntu.com>
2 Date: Wed, 2 Nov 2011 07:57:23 +0100
3 Subject: Allow boot entry to start with label instead of menu_label.
5 menu_ptr->menu_label is human-readable (perhaps even translatable!) text if
6 the MENU LABEL command is used, which isn't very convenient at the start of
7 a boot entry. Allow the entry to start with menu_ptr->label (an
8 identifier) as an alternative.
10 com32/gfxboot/gfxboot.c | 16 ++++++++++------
11 1 file changed, 10 insertions(+), 6 deletions(-)
13 diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
14 index f67132c..4c76a35 100644
15 --- a/com32/gfxboot/gfxboot.c
16 +++ b/com32/gfxboot/gfxboot.c
17 @@ -818,7 +818,7 @@ void boot(int index)
19 char *arg, *alt_kernel;
22 + int i, label_len, menu_label_len;
24 const struct syslinux_ipappend_strings *ipappend;
25 char *gfxboot_cwd = (char *) gfx_config.gfxboot_cwd;
26 @@ -836,18 +836,22 @@ void boot(int index)
27 if(!menu_ptr || !menu_ptr->menu_label) return;
29 arg = skipspace(cmdline);
30 - label_len = strlen(menu_ptr->menu_label);
31 + label_len = strlen(menu_ptr->label);
32 + menu_label_len = strlen(menu_ptr->menu_label);
34 // if it does not start with label string, assume first word is kernel name
35 - if(strncmp(arg, menu_ptr->menu_label, label_len)) {
36 + if(!strncmp(arg, menu_ptr->label, label_len)) {
39 + else if(!strncmp(arg, menu_ptr->menu_label, menu_label_len)) {
40 + arg += menu_label_len;
44 arg = skip_nonspaces(arg);
46 if(*alt_kernel) menu_ptr->alt_kernel = alt_kernel;