]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* kern/parser.c (grub_parser_execute): Cope with read-only config.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 1 May 2010 11:27:13 +0000 (13:27 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 1 May 2010 11:27:13 +0000 (13:27 +0200)
ChangeLog
kern/parser.c

index 530ecf32aa3c18cdfc823a46900156c759fba580..1b53d24f58f9dd698894008053b9fe9fd4bb7f57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 80312b9b4c23563bbfd01cc455622d67bfef0fb4..07597a1a89d5095044c264e8dfe96052d46a2fa1 100644 (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;
   }