HomeFreeBSD

lualoader: use floor division to get correct type

Description

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)

Details

Provenance
kevansAuthored on Jan 15 2021, 2:15 PM
Parents
rG8ec319d7922c: certctl: replace hardcoded uses of /usr/local
Branches
Unknown
Tags
Unknown