* [PATCH] print CR as hex in cat command
@ 2008-02-08 22:55 Christian Franke
2008-02-09 11:01 ` Robert Millan
0 siblings, 1 reply; 2+ messages in thread
From: Christian Franke @ 2008-02-08 22:55 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 432 bytes --]
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 <franke@computer.org>
* commands/cat.c (grub_cmd_cat): Print '\r' as hex to
avoid overwriting previous output.
* kern/rescue.c (grub_rescue_cmd_cat): Likewise.
[-- Attachment #2: grub2-cat-cr.patch --]
[-- Type: text/x-patch, Size: 855 bytes --]
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
{
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] print CR as hex in cat command
2008-02-08 22:55 [PATCH] print CR as hex in cat command Christian Franke
@ 2008-02-09 11:01 ` Robert Millan
0 siblings, 0 replies; 2+ messages in thread
From: Robert Millan @ 2008-02-09 11:01 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, Feb 08, 2008 at 11:55:48PM +0100, Christian Franke wrote:
> 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 <franke@computer.org>
>
> * commands/cat.c (grub_cmd_cat): Print '\r' as hex to
> avoid overwriting previous output.
> * kern/rescue.c (grub_rescue_cmd_cat): Likewise.
Committed.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-09 11:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-08 22:55 [PATCH] print CR as hex in cat command Christian Franke
2008-02-09 11:01 ` Robert Millan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.