From 8b6cfbd2b84fdfa9f54f77b235c799d975f84d58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?MrSm=C3=B6r?= <66489839+MrSmoer@users.noreply.github.com> Date: Thu, 16 Nov 2023 13:31:50 +0100 Subject: [PATCH] boot: padding for default arrow at too long lines If the default boot entry name doesnt leave enough space for the indicator arrow, it overwrote the first two characters of the entry Now every line will always have enough padding. --- src/boot/efi/boot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index f9b506808a1..1e1c6a433ed 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -746,6 +746,9 @@ static bool menu_run( lines[i] = xnew(char16_t, line_width + 1); padding = (line_width - MIN(strlen16(config->entries[i]->title_show), line_width)) / 2; + /* Make sure there is space for => */ + padding = MAX((size_t) 2, padding); + for (j = 0; j < padding; j++) lines[i][j] = ' '; -- 2.47.3