* normal/term.c (put_glyphs_terminal): Fix state->num_lines counting.

Reported and tested by: Colin Watson.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-07-10 02:23:48 +02:00
parent 3eaac1a13e
commit 249975ba6b
2 changed files with 16 additions and 9 deletions

View file

@ -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

View 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;