]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* normal/term.c (put_glyphs_terminal): Fix state->num_lines counting.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 10 Jul 2010 00:23:48 +0000 (02:23 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 10 Jul 2010 00:23:48 +0000 (02:23 +0200)
Reported and tested by: Colin Watson.

ChangeLog
normal/term.c

index 567736b39be7ee32fe989e6b3947269874a8a2f5..35ac246390fcaa20ec932992d77fc8e2279c3770 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * normal/term.c (put_glyphs_terminal): Fix state->num_lines counting.
+       Reported and tested by: Colin Watson.
+
 2010-07-10  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub-mkrescue.in: Don't use tar GNU-ism since it's not necessary
index 46ca958433fbf5bb9bd560ce0b34b73a13cabd90..4f5779abe5c711efccb712d116fb0fb4ee33e651 100644 (file)
@@ -616,16 +616,18 @@ put_glyphs_terminal (const struct grub_unicode_glyph *visual,
       if (visual_ptr->base == '\n')
        grub_print_spaces (term, margin_right);
       putglyph (visual_ptr, term);
-      if (state && ++state->num_lines
-         >= (grub_ssize_t) grub_term_height (term) - 2)
-      {
-       state->backlog_glyphs = visual_ptr + 1;
-       state->backlog_len = visual_len - (visual - visual_ptr) - 1;
-       return 1;
-      }
-
       if (visual_ptr->base == '\n')
-       grub_print_spaces (term, margin_left);
+       {
+         if (state && ++state->num_lines
+             >= (grub_ssize_t) grub_term_height (term) - 2)
+           {
+             state->backlog_glyphs = visual_ptr + 1;
+             state->backlog_len = visual_len - (visual - visual_ptr) - 1;
+             return 1;
+           }
+
+         grub_print_spaces (term, margin_left);
+       }
       grub_free (visual_ptr->combining);
     }
   return 0;