Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Sep 2021 05:42:20 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: ea03e7dbeea0 - stable/12 - loader: do not output empty menu title
Message-ID:  <202109120542.18C5gKSd009565@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=ea03e7dbeea0d8287b83fb6f8e3c68e81abeba18

commit ea03e7dbeea0d8287b83fb6f8e3c68e81abeba18
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2021-04-21 11:42:10 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-09-12 05:39:19 +0000

    loader: do not output empty menu title
    
    As we output spaces around the menu title, we should also check,
    if the title is actually empty string.
    
    PR:             255299
    Submitted by:   Jose Luis Duran
    Reported by:    Jose Luis Duran
    
    (cherry picked from commit 4ba91fa0736bb0672d475b6b56d9e7b06e78ff69)
---
 stand/forth/menu.4th | 6 +++++-
 stand/lua/drawer.lua | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/stand/forth/menu.4th b/stand/forth/menu.4th
index c67d6f8f4f6e..73eb88c1ef0c 100644
--- a/stand/forth/menu.4th
+++ b/stand/forth/menu.4th
@@ -490,7 +490,11 @@ also menu-infrastructure definitions
 		menuX @ 19 + over 2 / - menuY @ 1-
 	then
 	swap 1- swap
-	at-xy space type space
+	at-xy dup 0= if
+		2drop ( empty loader_menu_title )
+	else
+		space type space
+	then
 
 	\ If $menu_init is set, evaluate it (allowing for whole menus to be
 	\ constructed dynamically -- as this function could conceivably set
diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
index 7c1a05448871..8a0fe3bb066e 100644
--- a/stand/lua/drawer.lua
+++ b/stand/lua/drawer.lua
@@ -268,7 +268,10 @@ local function drawbox()
 		menu_header_x = x + (w // 2) - (#menu_header // 2)
 	end
 	screen.setcursor(menu_header_x - 1, y)
-	printc(" " .. menu_header .. " ")
+	if menu_header ~= "" then
+		printc(" " .. menu_header .. " ")
+	end
+
 end
 
 local function drawbrand()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109120542.18C5gKSd009565>