[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] normal: fix get_logical_num_lines
From: |
Andrei Borzenkov |
Subject: |
Re: [PATCH] normal: fix get_logical_num_lines |
Date: |
Wed, 23 Dec 2015 09:26:43 +0300 |
On Wed, Dec 23, 2015 at 7:45 AM, Michael Chang <address@hidden> wrote:
> In menu editing mode, grub2 shows bogus line if the character being
> edited is at last column of entry. This patch fixes the problem by
> having the get_logical_num_lines function to calculate correct number of
> lines.
>
There is one more occurrence in update_screen (); could you check if
this needs fix too?
grub_size_t t = grub_getstringwidth (linep->buf, linep->buf + screen->column,
term_screen->term);
y += t / (unsigned) term_screen->geo.entry_width;
> ---
> grub-core/normal/menu_entry.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c
> index 62c7e16..1d4b0c6 100644
> --- a/grub-core/normal/menu_entry.c
> +++ b/grub-core/normal/menu_entry.c
> @@ -128,7 +128,7 @@ get_logical_num_lines (struct line *linep, struct
> per_term_screen *term_screen)
> {
> return (grub_getstringwidth (linep->buf, linep->buf + linep->len,
> term_screen->term)
> - / (unsigned) term_screen->geo.entry_width) + 1;
> + / ((unsigned) term_screen->geo.entry_width + 1)) + 1;
> }
>
> static void
> --
> 2.6.3
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel