From owner-dev-commits-src-branches@freebsd.org Sun Sep 12 05:42:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9458B67E525; Sun, 12 Sep 2021 05:42:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H6dmF1MG5z3jjk; Sun, 12 Sep 2021 05:42:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED46A65E5; Sun, 12 Sep 2021 05:42:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18C5gKDP009566; Sun, 12 Sep 2021 05:42:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18C5gKSd009565; Sun, 12 Sep 2021 05:42:20 GMT (envelope-from git) Date: Sun, 12 Sep 2021 05:42:20 GMT Message-Id: <202109120542.18C5gKSd009565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: ea03e7dbeea0 - stable/12 - loader: do not output empty menu title MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ea03e7dbeea0d8287b83fb6f8e3c68e81abeba18 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2021 05:42:22 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ea03e7dbeea0d8287b83fb6f8e3c68e81abeba18 commit ea03e7dbeea0d8287b83fb6f8e3c68e81abeba18 Author: Toomas Soome AuthorDate: 2021-04-21 11:42:10 +0000 Commit: Kyle Evans 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()