Accepting request 352681 from home:arvidjaar:bnc:943585

- Add 0001-menu-fix-line-count-calculation-for-long-lines.patch (bsc#943585)

OBS-URL: https://build.opensuse.org/request/show/352681
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=198
This commit is contained in:
Michael Chang 2016-01-11 03:23:17 +00:00 committed by Git OBS Bridge
parent f43b54606a
commit 1bfe49b1fe
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From 7c1f98869a1aedc2210c4d9e5ad9828eeb2dda72 Mon Sep 17 00:00:00 2001
From: Andrei Borzenkov <arvidjaar@gmail.com>
Date: Mon, 28 Dec 2015 19:48:44 +0300
Subject: [PATCH] menu: fix line count calculation for long lines
It gave one extra screen line if length was exactly equal to screen
width.
Reported by Michael Chang.
Also-By: Michael Chang <mchang@suse.com>
---
grub-core/normal/menu_entry.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c
index 62c7e16..2b73225 100644
--- a/grub-core/normal/menu_entry.c
+++ b/grub-core/normal/menu_entry.c
@@ -126,9 +126,13 @@ ensure_space (struct line *linep, int extra)
static int
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;
+ grub_size_t width = grub_getstringwidth (linep->buf, linep->buf + linep->len,
+ term_screen->term);
+
+ /* Empty line still consumes space on screen */
+ return width ? (width + (unsigned) term_screen->geo.entry_width - 1) /
+ (unsigned) term_screen->geo.entry_width
+ : 1;
}
static void
--
1.9.1

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Mon 28 16:53:54 UTC 2015 - arvidjaar@gmail.com
- Add 0001-menu-fix-line-count-calculation-for-long-lines.patch (bsc#943585)
-------------------------------------------------------------------
Thu Dec 17 11:04:06 UTC 2015 - olaf@aepfle.de

View File

@ -206,6 +206,7 @@ Patch69: grub2-getroot-fix-get-btrfs-fs-prefix-big-endian.patch
Patch70: grub2-default-distributor.patch
Patch71: grub2-menu-unrestricted.patch
Patch72: 0001-Fix-security-issue-when-reading-username-and-passwor.patch
Patch73: 0001-menu-fix-line-count-calculation-for-long-lines.patch
# Btrfs snapshot booting related patches
Patch101: grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch
Patch102: grub2-btrfs-02-export-subvolume-envvars.patch
@ -481,6 +482,7 @@ mv po/grub.pot po/%{name}.pot
%patch70 -p1
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1