aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2021-01-15 14:15:40 +0000
committerKyle Evans <kevans@FreeBSD.org>2021-01-24 02:57:02 +0000
commit9ffee7b1eaeb4b48acd89d7be95fe627e9626724 (patch)
tree395ff6ff302b92dba6e4ce5daf66b91d32d6767e
parent8ec319d7922c6e3e95d79882f2103768b96ee95a (diff)
downloadsrc-9ffee7b1eaeb4b48acd89d7be95fe627e9626724.tar.gz
src-9ffee7b1eaeb4b48acd89d7be95fe627e9626724.zip
lualoader: use floor division to get correct type
This fixes the positioning of the "Welcome to FreeBSD" heading, which was misplaced after the recent update to Lua 5.4. The issue was previously masked by a compatibility knob in Lua 5.3 that would cause float-tagged numbers to render faithfully without the decimal component. Lua 5.4 dropped that and ensures that it always prints a decimal component, even if it has to append a ".0" to the value. Standard division produces a "float", floor division (//) can be used to guarantee an integer. Floating point operations have been completely ripped out of the liblua compiled for the bootloader, so this is a nop. This is decidedly better than trying to hack out the float tag entirely. (cherry picked from commit 994e1f40f6db059290cf4a8203c2b9eea22d9a38)
-rw-r--r--stand/lua/drawer.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
index f54b9307637a..49f71c12b9d9 100644
--- a/stand/lua/drawer.lua
+++ b/stand/lua/drawer.lua
@@ -265,7 +265,7 @@ local function drawbox()
end
end
if menu_header_x == nil then
- menu_header_x = x + (w / 2) - (#menu_header / 2)
+ menu_header_x = x + (w // 2) - (#menu_header // 2)
end
screen.setcursor(menu_header_x, y)
printc(menu_header)