]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
lualoader: use floor division to get correct type
authorKyle Evans <kevans@FreeBSD.org>
Fri, 15 Jan 2021 14:15:40 +0000 (08:15 -0600)
committerKyle Evans <kevans@FreeBSD.org>
Fri, 15 Jan 2021 21:02:38 +0000 (15:02 -0600)
commit994e1f40f6db059290cf4a8203c2b9eea22d9a38
treea73e2e374ea7219e78993fe2673680f0fba6a6ef
parentc664d8dfc3dd65611f63ca8277841a29a46260f1
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.

Reported-by: mjg, probably others
MFC-after: 3 days
stand/lua/drawer.lua