OCaml 4.14.0 rebuild
[arch-packages.git] / syslinux / trunk / 0002-gfxboot-menu-label.patch
blob0666a8832a70a560fda150a86daa13bfc5cb48f8
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.
9 ---
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;
20 menu_t *menu_ptr;
21 - int i, label_len;
22 + int i, label_len, menu_label_len;
23 unsigned ipapp;
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)) {
37 + arg += label_len;
38 + }
39 + else if(!strncmp(arg, menu_ptr->menu_label, menu_label_len)) {
40 + arg += menu_label_len;
41 + }
42 + else {
43 alt_kernel = arg;
44 arg = skip_nonspaces(arg);
45 if(*arg) *arg++ = 0;
46 if(*alt_kernel) menu_ptr->alt_kernel = alt_kernel;
48 - else {
49 - arg += label_len;
50 - }
52 arg = skipspace(arg);