cat: Don't switch terminal mode when there is nothing to highlight.

This just pollutes serial console.
This commit is contained in:
Vladimir Serbinenko committed 2016-02-27 13:35:36 +01:00
1 parent 070e190305
commit 8c26dace6f
1 file changed
+7 -4
+7 -4
View File
@@ -140,10 +140,13 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
} }
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); if (utcount)
for (j = 0; j < utcount; j++) {
grub_printf ("<%x>", (unsigned int) utbuf[j]); grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); for (j = 0; j < utcount; j++)
grub_printf ("<%x>", (unsigned int) utbuf[j]);
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
}
grub_xputs ("\n"); grub_xputs ("\n");
grub_refresh (); grub_refresh ();