From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RMw3S-0007dG-Ul for mharc-grub-devel@gnu.org; Sun, 06 Nov 2011 01:18:06 -0500 Received: from eggs.gnu.org ([140.186.70.92]:34212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMw3Q-0007bZ-QW for grub-devel@gnu.org; Sun, 06 Nov 2011 01:18:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMw3Q-0005gA-0M for grub-devel@gnu.org; Sun, 06 Nov 2011 01:18:04 -0500 Received: from mail-gx0-f169.google.com ([209.85.161.169]:53262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMw3P-0005g2-UA for grub-devel@gnu.org; Sun, 06 Nov 2011 01:18:03 -0500 Received: by ggnh4 with SMTP id h4so4649033ggn.0 for ; Sat, 05 Nov 2011 23:18:02 -0700 (PDT) Received: by 10.236.185.228 with SMTP id u64mr28266809yhm.91.1320560282416; Sat, 05 Nov 2011 23:18:02 -0700 (PDT) Received: from crass-z570.?null? (cpe-70-113-31-121.austin.res.rr.com. [70.113.31.121]) by mx.google.com with ESMTPS id 32sm24213313anu.10.2011.11.05.23.18.01 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Nov 2011 23:18:01 -0700 (PDT) Date: Sun, 6 Nov 2011 01:17:58 -0500 From: Glenn Washburn To: grub-devel@gnu.org Subject: [PATCH] Add comments to rescue parser Message-ID: <4eb62699.2015640a.1e6f.79c7@mx.google.com> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.6; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/QxcwLrQj=exVWkbS9_/u+Te" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.169 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 06:18:05 -0000 --MP_/QxcwLrQj=exVWkbS9_/u+Te Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 --MP_/QxcwLrQj=exVWkbS9_/u+Te Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=grub.rescue_parser_comments.patch === 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); --MP_/QxcwLrQj=exVWkbS9_/u+Te--