mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
lualoader: Remove nasty hack for not printing out ".0"
luaconf.h has a LUA_COMPAT_FLOATSTRING option that may be defined to do this instead of needing intstring. Reported by: Dan Nelson
This commit is contained in:
parent
d208c07cf3
commit
1ea2995427
2 changed files with 2 additions and 12 deletions
|
|
@ -405,6 +405,7 @@
|
|||
** because this is not really an incompatibility.
|
||||
*/
|
||||
/* #define LUA_COMPAT_FLOATSTRING */
|
||||
#define LUA_COMPAT_FLOATSTRING
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
|
|
|||
|
|
@ -31,17 +31,6 @@ local core = require("core")
|
|||
|
||||
local screen = {}
|
||||
|
||||
-- XXX TODO: This should be fixed in the interpreter to not print decimals
|
||||
local intstring = function(num)
|
||||
local str = tostring(num)
|
||||
local decimal = str:find("%.")
|
||||
|
||||
if decimal then
|
||||
return str:sub(1, decimal - 1)
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
||||
-- Module exports
|
||||
function screen.clear()
|
||||
if core.isSerialBoot() then
|
||||
|
|
@ -55,7 +44,7 @@ function screen.setcursor(x, y)
|
|||
return
|
||||
end
|
||||
|
||||
loader.printc("\027[" .. intstring(y) .. ";" .. intstring(x) .. "H")
|
||||
loader.printc("\027[" .. y .. ";" .. x .. "H")
|
||||
end
|
||||
|
||||
function screen.setforeground(c)
|
||||
|
|
|
|||
Loading…
Reference in a new issue