]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-13 Vladimir Serbinenko <phcoder@gmail.com>
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 13 Jan 2010 19:43:48 +0000 (20:43 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 13 Jan 2010 19:43:48 +0000 (20:43 +0100)
* term/ieee1275/ofconsole.c (grub_ofconsole_putchar): Handle '\r'.
(grub_ofconsole_getwh): Split to ...
(grub_ofconsole_getwh): ... this.
(grub_ofconsole_dimensions): ...and this.
(grub_ofconsole_init_output): Call grub_ofconsole_dimensions.

ChangeLog
term/ieee1275/ofconsole.c

index 788328502d74fa3a4a6bbad57a82a9e10e526068..95eebe4b2b9923f9989b6bbe87c7ab9f3248fbe0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-01-13  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * term/ieee1275/ofconsole.c (grub_ofconsole_putchar): Handle '\r'.
+       (grub_ofconsole_getwh): Split to ...
+       (grub_ofconsole_getwh): ... this.
+       (grub_ofconsole_dimensions): ...and this.
+       (grub_ofconsole_init_output): Call grub_ofconsole_dimensions.
+
 2010-01-13  Robert Millan  <rmh.grub@aybabtu.com>
 
        * util/mkisofs/rock.c (generate_rock_ridge_attributes): Fix a typo.
index 3977c6286da9a7bbe600ae0e025b6350fc3774fb..a9834e23e581dc4067df518058c09c73ba7ec797 100644 (file)
@@ -83,12 +83,17 @@ grub_ofconsole_putchar (grub_uint32_t c)
       grub_curr_y++;
       grub_curr_x = 0;
     }
+  else if (c == '\r')
+    {
+      grub_curr_x = 0;
+    }
   else
     {
       grub_curr_x++;
-      if (grub_curr_x > grub_ofconsole_width)
+      if (grub_curr_x >= grub_ofconsole_width)
         {
           grub_ofconsole_putchar ('\n');
+          grub_ofconsole_putchar ('\r');
           grub_curr_x++;
         }
     }
@@ -234,16 +239,13 @@ grub_ofconsole_getxy (void)
   return ((grub_curr_x - 1) << 8) | grub_curr_y;
 }
 
-static grub_uint16_t
-grub_ofconsole_getwh (void)
+static void
+grub_ofconsole_dimensions (void)
 {
   grub_ieee1275_ihandle_t options;
   char *val;
   grub_ssize_t lval;
 
-  if (grub_ofconsole_width && grub_ofconsole_height)
-    return (grub_ofconsole_width << 8) | grub_ofconsole_height;
-
   if (! grub_ieee1275_finddevice ("/options", &options)
       && options != (grub_ieee1275_ihandle_t) -1)
     {
@@ -280,7 +282,11 @@ grub_ofconsole_getwh (void)
     grub_ofconsole_width = 80;
   if (! grub_ofconsole_height)
     grub_ofconsole_height = 24;
+}
 
+static grub_uint16_t
+grub_ofconsole_getwh (void)
+{
   return (grub_ofconsole_width << 8) | grub_ofconsole_height;
 }
 
@@ -379,6 +385,8 @@ grub_ofconsole_init_output (void)
       grub_ofconsole_setcolorstate (GRUB_TERM_COLOR_NORMAL);
     }
 
+  grub_ofconsole_dimensions ();
+
   return 0;
 }