]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: padding for default arrow at too long lines
authorMrSmör <66489839+MrSmoer@users.noreply.github.com>
Thu, 16 Nov 2023 12:31:50 +0000 (13:31 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Feb 2024 13:36:52 +0000 (14:36 +0100)
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

index f9b506808a1728a4145cc4ee8cdfda33ba25a8ee..1e1c6a433eda167222918939703af8c8653cf544 100644 (file)
@@ -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] = ' ';