* kern/parser.c (grub_parser_execute): Cope with read-only config.
This commit is contained in:
parent
6f8aaf68be
commit
3080f7a7bd
2 changed files with 8 additions and 5 deletions
|
@ -249,12 +249,11 @@ grub_parser_execute (char *source)
|
|||
}
|
||||
|
||||
p = grub_strchr (source, '\n');
|
||||
if (p)
|
||||
*p = 0;
|
||||
|
||||
*line = grub_strdup (source);
|
||||
if (p)
|
||||
*p = '\n';
|
||||
*line = grub_strndup (source, p - source);
|
||||
else
|
||||
*line = grub_strdup (source);
|
||||
source = p ? p + 1 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue