Fix handling of leading spaces in scripts.
* grub-core/normal/cmdline.c (grub_cmdline_get): Don't strip leading spaces. * grub-core/normal/main.c (grub_file_getline): Remove all preprocessing other than skipping \r. All users updated. * tests/grub_script_echo1.in: Add space-related tests. * util/grub-menulst2cfg.c (main): Remove useless space skipping.
This commit is contained in:
parent
1a1ac4f6cb
commit
9fdb2d7b11
10 changed files with 104 additions and 66 deletions
|
@ -338,7 +338,11 @@ read_terminal_list (const char *prefix)
|
|||
if (! buf)
|
||||
break;
|
||||
|
||||
switch (buf[0])
|
||||
p = buf;
|
||||
while (grub_isspace (p[0]))
|
||||
p++;
|
||||
|
||||
switch (p[0])
|
||||
{
|
||||
case 'i':
|
||||
target = &grub_term_input_autoload;
|
||||
|
@ -351,15 +355,15 @@ read_terminal_list (const char *prefix)
|
|||
if (!target)
|
||||
continue;
|
||||
|
||||
name = buf + 1;
|
||||
name = p + 1;
|
||||
|
||||
p = grub_strchr (name, ':');
|
||||
if (! p)
|
||||
continue;
|
||||
|
||||
*p = '\0';
|
||||
while (*++p == ' ')
|
||||
;
|
||||
|
||||
p++;
|
||||
while (*p == ' ' || *p == '\t')
|
||||
p++;
|
||||
|
||||
cur = grub_malloc (sizeof (*cur));
|
||||
if (!cur)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue