]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix paging.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 24 Dec 2009 22:37:38 +0000 (23:37 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 24 Dec 2009 22:37:38 +0000 (23:37 +0100)
kern/term.c
normal/term.c

index 51eee3b08d9776e071ad21939cd2ab91ac568418..8f8576aa27b5a797175212b76a2e07266e7ef176 100644 (file)
@@ -34,10 +34,6 @@ void (*grub_newline_hook) (void) = NULL;
 void
 grub_putcode (grub_uint32_t code, struct grub_term_output *term)
 {
-  int height;
-
-  height = grub_term_height (term);
-
   if (code == '\t' && term->getxy)
     {
       int n;
@@ -62,7 +58,7 @@ grub_putchar (int c)
   static grub_size_t size = 0;
   static grub_uint8_t buf[6];
   grub_uint32_t code;
-  grub_ssize_t ret;
+  grub_size_t ret;
 
   buf[size++] = c;
   ret = grub_utf8_to_ucs4 (&code, 1, buf, size, 0);
@@ -73,9 +69,9 @@ grub_putchar (int c)
       size = 0;
       FOR_ACTIVE_TERM_OUTPUTS(term)
        grub_putcode (code, term);
+      if (code == '\n' && grub_newline_hook)
+       grub_newline_hook ();
     }
-  if (ret == '\n' && grub_newline_hook)
-    grub_newline_hook ();
 }
 
 int
index eb8f8e8440d73e3416a930e707e13d2f56c8b73a..5a8e9cffc815667a9451998cacc6e6ac69c7e5fe 100644 (file)
@@ -37,7 +37,7 @@ process_newline (void)
       height = grub_term_height (cur);
   grub_more_lines++;
 
-  if (grub_more && grub_more_lines == height - 1)
+  if (grub_more && grub_more_lines >= height - 1)
     {
       char key;
       grub_uint16_t *pos;
@@ -57,7 +57,7 @@ process_newline (void)
 
       /* Scroll one lines or an entire page, depending on the key.  */
       if (key == '\r' || key =='\n')
-       grub_more_lines--;
+       grub_more_lines = height - 2;
       else
        grub_more_lines = 0;
     }