Skip to contentSkip to conversation

Fix cut menuentry on failed boot

BUGFIX Vladimir 'phcoder' Serbinenko 1 participant 1 message Jul 23, 2009

lore
Share & tools
lore
#0 lore raw

Hello. If syntax error in menu entry occurs it oftens results in the menu cut after first line. Here is the fix

Signature · 4 lines
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
ChangeLog +5 -0
index a0780ab..8824f1c 100644
@@ -1,3 +1,8 @@
+2009-07-23  Vladimir Serbinenko  <[email protected]>
+
+	* kern/parser.c (grub_parser_execute): Fix a bug causing truncated
+	entries on failed boot.
+
 2009-07-21  Vladimir Serbinenko  <[email protected]>
 
 	UUID support for UFS
kern/parser.c +4 -2
index 5e56ede..db59af0 100644
@@ -245,10 +245,12 @@ grub_parser_execute (char *source)
 
       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;
     }