Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OQSrg-000775-Lf for mharc-grub-devel@gnu.org; Sun, 20 Jun 2010 18:19:44 -0400 Received: from [140.186.70.92] (port=47524 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQSrd-000759-9U for grub-devel@gnu.org; Sun, 20 Jun 2010 18:19:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQSrc-0007IQ-66 for grub-devel@gnu.org; Sun, 20 Jun 2010 18:19:41 -0400 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:43228) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OQSrc-0007IA-1q for grub-devel@gnu.org; Sun, 20 Jun 2010 18:19:40 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1OQSrZ-0004X5-Ut; Sun, 20 Jun 2010 22:19:38 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) id 1OQSrZ-0002MC-00; Sun, 20 Jun 2010 23:19:37 +0100 Date: Sun, 20 Jun 2010 23:19:37 +0100 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20100620221937.GS12396@riva.ucam.org> References: <20100618183408.12015.77315.reportbug@feather> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100618183408.12015.77315.reportbug@feather> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost03-IP: [82.69.40.219] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: 586358-forwarded@bugs.debian.org, Josh Triplett Subject: Re: Bug#586358: grub-pc: Please handle DOS line endings in "cat" X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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, 20 Jun 2010 22:19:43 -0000 On Fri, Jun 18, 2010 at 11:34:08AM -0700, Josh Triplett wrote: > The "cat" command, if given a file with DOS line endings, will show the > \r at the end of every line as a control character. For convenience, > please consider adding support for this in "cat", ideally automatically. Makes sense to me. grub-devel, how about this patch? 2010-06-20 Colin Watson * commands/cat.c (grub_cmd_cat): Print DOS "\r\n" line endings as simple newlines. === modified file 'commands/cat.c' --- commands/cat.c 2010-03-01 19:24:34 +0000 +++ commands/cat.c 2010-06-20 22:11:37 +0000 @@ -54,6 +54,11 @@ grub_cmd_cat (grub_command_t cmd __attri if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') grub_putchar (c); + else if (c == '\r' && buf[i + 1] == '\n') + { + grub_putchar ('\n'); + i++; + } else { grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); Thanks, -- Colin Watson [cjwatson@ubuntu.com]