Skip to contentSkip to conversation

Add comments to rescue parser

PATCH New Glenn Washburn 1 participant 1 message Nov 6, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add comments to rescue parser

Hi all,

Attached is an extremely simple patch to support full line comments (lines prefixed by a '#'). This was useful to me to have comments in an embedded config file without the rescue parser complaining. It might be nice to have comments at the tail of commands, and I haven't tested to see if this works with comments preceded by spaces. Let me know if there's a better way to handle this.

Glenn

=== modified file 'grub-core/kern/rescue_parser.c'

kern/rescue_parser.c +2 -2
@@ -52,8 +52,8 @@
   /* Get the command name.  */
   name = args[0];
 
-  /* If nothing is specified, restart.  */
-  if (*name == '\0')
+  /* If nothing is specified or a comment, restart.  */
+  if (*name == '\0' || *name == '#')
     goto quit;
 
   cmd = grub_command_find (name);