1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
Author: Colin Watson <cjwatson@ubuntu.com>
Description:
Allow boot entry to start with label instead of menu_label.
.
menu_ptr->menu_label is human-readable (perhaps even translatable!) text if
the MENU LABEL command is used, which isn't very convenient at the start of
a boot entry. Allow the entry to start with menu_ptr->label (an
identifier) as an alternative.
diff -Naurp syslinux.orig/com32/gfxboot/gfxboot.c syslinux/com32/gfxboot/gfxboot.c
--- syslinux.orig/com32/gfxboot/gfxboot.c 2011-12-23 13:50:16.742778358 +0100
+++ syslinux/com32/gfxboot/gfxboot.c 2011-12-23 14:33:35.487667657 +0100
@@ -810,7 +810,7 @@ void boot(int index)
{
char *arg, *alt_kernel;
menu_t *menu_ptr;
- int i, label_len;
+ int i, label_len, menu_label_len;
unsigned ipapp;
const struct syslinux_ipappend_strings *ipappend;
char *gfxboot_cwd = (char *) gfx_config.gfxboot_cwd;
@@ -828,18 +828,22 @@ void boot(int index)
if(!menu_ptr || !menu_ptr->menu_label) return;
arg = skipspace(cmdline);
- label_len = strlen(menu_ptr->menu_label);
+ label_len = strlen(menu_ptr->label);
+ menu_label_len = strlen(menu_ptr->menu_label);
// if it does not start with label string, assume first word is kernel name
- if(strncmp(arg, menu_ptr->menu_label, label_len)) {
+ if(!strncmp(arg, menu_ptr->label, label_len)) {
+ arg += label_len;
+ }
+ else if(!strncmp(arg, menu_ptr->menu_label, menu_label_len)) {
+ arg += menu_label_len;
+ }
+ else {
alt_kernel = arg;
arg = skip_nonspaces(arg);
if(*arg) *arg++ = 0;
if(*alt_kernel) menu_ptr->alt_kernel = alt_kernel;
}
- else {
- arg += label_len;
- }
arg = skipspace(arg);
|