print CR as hex in cat command
PATCH 1/1 print CR as hex in cat command
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 <[email protected]>
* commands/cat.c (grub_cmd_cat): Print '\r' as hex to avoid overwriting previous output.
* kern/rescue.c (grub_rescue_cmd_cat): Likewise.
commands/cat.c +1 -1
@@ -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 {
kern/rescue.c +1 -1
@@ -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 {
Quoted 6 lines · Christian Franke
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.
Quoted 7 lines
Christian
2008-02-08 Christian Franke <[email protected]>
*
commands/cat.c(grub_cmd_cat): Print '\r' as hex to avoid overwriting previous output.
*kern/rescue.c(grub_rescue_cmd_cat): Likewise.
Committed.
Signature · 5 lines
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 /.)