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 <cjwat...@ubuntu.com> * 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 [cjwat...@ubuntu.com] _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel