From 249975ba6b1439f385078c4b874505eb585207f8 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 10 Jul 2010 02:23:48 +0200 Subject: [PATCH] * normal/term.c (put_glyphs_terminal): Fix state->num_lines counting. Reported and tested by: Colin Watson. --- ChangeLog | 5 +++++ normal/term.c | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 567736b39..35ac24639 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-07-10 Vladimir Serbinenko + + * normal/term.c (put_glyphs_terminal): Fix state->num_lines counting. + Reported and tested by: Colin Watson. + 2010-07-10 Vladimir Serbinenko * util/grub-mkrescue.in: Don't use tar GNU-ism since it's not necessary diff --git a/normal/term.c b/normal/term.c index 46ca95843..4f5779abe 100644 --- a/normal/term.c +++ b/normal/term.c @@ -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;