From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JNc8P-00059b-QU for mharc-grub-devel@gnu.org; Fri, 08 Feb 2008 17:55:53 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNc8O-00058v-2B for grub-devel@gnu.org; Fri, 08 Feb 2008 17:55:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNc8N-00058U-DA for grub-devel@gnu.org; Fri, 08 Feb 2008 17:55:51 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNc8N-00058M-8c for grub-devel@gnu.org; Fri, 08 Feb 2008 17:55:51 -0500 Received: from mailout01.sul.t-online.de ([194.25.134.80] helo=mailout01.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JNc8N-0007f0-0G for grub-devel@gnu.org; Fri, 08 Feb 2008 17:55:51 -0500 Received: from fwd31.aul.t-online.de by mailout01.sul.t-online.com with smtp id 1JNc8J-0000Az-00; Fri, 08 Feb 2008 23:55:47 +0100 Received: from [10.3.2.2] (XZvFOyZr8hZ+5ZusVcBrljm6c9OHLS6wNPYUhdIGzzV0NEdwU2oEkXDXiFMMBvHZap@[217.235.194.131]) by fwd31.aul.t-online.de with esmtp id 1JNc8F-1s7rXc0; Fri, 8 Feb 2008 23:55:43 +0100 Message-ID: <47ACDDF4.5040307@t-online.de> Date: Fri, 08 Feb 2008 23:55:48 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7 MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: multipart/mixed; boundary="------------010403020201080808060709" X-ID: XZvFOyZr8hZ+5ZusVcBrljm6c9OHLS6wNPYUhdIGzzV0NEdwU2oEkXDXiFMMBvHZap X-TOI-MSGID: 0cdf368e-14a8-4823-85d5-a42492552c23 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [PATCH] print CR as hex in cat command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2008 22:55:52 -0000 This is a multi-part message in MIME format. --------------010403020201080808060709 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Here a small patch for a minor issue: cat command does not work well for files including '\r' because the previous line may be overwritten. In grub-emu, files with cr/lf line endings are invisible due to ncurses behavior. Christian 2008-02-08 Christian Franke * commands/cat.c (grub_cmd_cat): Print '\r' as hex to avoid overwriting previous output. * kern/rescue.c (grub_rescue_cmd_cat): Likewise. --------------010403020201080808060709 Content-Type: text/x-patch; name="grub2-cat-cr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-cat-cr.patch" diff -rup grub2.orig/commands/cat.c grub2/commands/cat.c --- grub2.orig/commands/cat.c 2007-07-22 01:32:19.000000000 +0200 +++ grub2/commands/cat.c 2007-11-02 21:24:33.375000000 +0100 @@ -50,7 +50,7 @@ grub_cmd_cat (struct grub_arg_list *stat { unsigned char c = buf[i]; - if (grub_isprint (c) || grub_isspace (c)) + if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') grub_putchar (c); else { diff -rup grub2.orig/kern/rescue.c grub2/kern/rescue.c --- grub2.orig/kern/rescue.c 2008-02-03 20:29:52.968750000 +0100 +++ grub2/kern/rescue.c 2008-02-08 23:30:37.656250000 +0100 @@ -151,7 +151,7 @@ grub_rescue_cmd_cat (int argc, char *arg { unsigned char c = buf[i]; - if (grub_isprint (c) || grub_isspace (c)) + if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') grub_putchar (c); else { --------------010403020201080808060709--