* kern/parser.c (grub_parser_execute): Cope with read-only config.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-05-01 13:27:13 +02:00
parent 6f8aaf68be
commit 3080f7a7bd
2 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,10 @@
2010-05-01 Vladimir Serbinenko <phcoder@gmail.com>
MErge handling of input and output terminals. Fix a hang.
* kern/parser.c (grub_parser_execute): Cope with read-only config.
2010-05-01 Vladimir Serbinenko <phcoder@gmail.com>
Merge handling of input and output terminals. Fix a hang.
* commands/terminal.c (abstract_terminal): New struct.
(handle_command): New function. Based on grub_cmd_terminal_input.

View File

@ -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;
}