grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add comments to rescue parser
@ 2011-11-06  6:17 Glenn Washburn
  0 siblings, 0 replies; only message in thread
From: Glenn Washburn @ 2011-11-06  6:17 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

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

[-- Attachment #2: grub.rescue_parser_comments.patch --]
[-- Type: text/x-patch, Size: 459 bytes --]

=== modified file 'grub-core/kern/rescue_parser.c'
--- grub-core/kern/rescue_parser.c	2010-03-26 23:19:42 +0000
+++ grub-core/kern/rescue_parser.c	2011-11-05 01:15:31 +0000
@@ -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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-11-06  6:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-06  6:17 [PATCH] Add comments to rescue parser Glenn Washburn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).