[2445] 2009-07-25 Vladimir Serbinenko <[email protected]>

Vladimir Serbinenko <[email protected]> Sat, 25 Jul 2009 15:13:07 +0000
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2445
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2445
Author:   phcoder
Date:     2009-07-25 15:13:07 +0000 (Sat, 25 Jul 2009)
Log Message:
-----------
2009-07-25  Vladimir Serbinenko  <[email protected]>

	* kern/parser.c (grub_parser_execute): Fix a bug causing truncated
	entries on failed boot.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/kern/parser.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-07-25 09:30:25 UTC (rev 2444)
+++ trunk/grub2/ChangeLog	2009-07-25 15:13:07 UTC (rev 2445)
@@ -1,3 +1,8 @@
+2009-07-25  Vladimir Serbinenko  <[email protected]>
+
+	* kern/parser.c (grub_parser_execute): Fix a bug causing truncated
+	entries on failed boot.
+
 2009-07-25  Felix Zielcke  <[email protected]>
 
 	* kern/file.c (grub_file_open): Fix an error check.

Modified: trunk/grub2/kern/parser.c
===================================================================
--- trunk/grub2/kern/parser.c	2009-07-25 09:30:25 UTC (rev 2444)
+++ trunk/grub2/kern/parser.c	2009-07-25 15:13:07 UTC (rev 2445)
@@ -245,10 +245,12 @@
 
       p = grub_strchr (source, '\n');
       if (p)
-	*(p++) = 0;
+	*p = 0;
 
       *line = grub_strdup (source);
-      source = p;
+      if (p)
+	*p = '\n';
+      source = p ? p + 1 : 0;
       return 0;
     }