All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] normal: fix get_logical_num_lines
@ 2015-12-23  4:45 Michael Chang
  2015-12-23  6:26 ` Andrei Borzenkov
  2015-12-24 11:48 ` Andrei Borzenkov
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Chang @ 2015-12-23  4:45 UTC (permalink / raw)
  To: grub-devel

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.

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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-29 19:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-23  4:45 [PATCH] normal: fix get_logical_num_lines Michael Chang
2015-12-23  6:26 ` Andrei Borzenkov
2015-12-23  8:38   ` Michael Chang
2015-12-24 11:48 ` Andrei Borzenkov
2015-12-28  4:09   ` Michael Chang
2015-12-28  4:28     ` Michael Chang
2015-12-29 19:21     ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.