From 59cccc5bce423fa78b8124f6fc1c3ed4661e5ab5 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Fri, 2 Mar 2018 15:46:22 +0000 Subject: [PATCH] lualoader: Register loader.printc as global printc --- stand/liblua/lutils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stand/liblua/lutils.c b/stand/liblua/lutils.c index 38392b039688..4547097f1cf9 100644 --- a/stand/liblua/lutils.c +++ b/stand/liblua/lutils.c @@ -307,6 +307,7 @@ static const struct luaL_Reg loaderlib[] = { REG_SIMPLE(command), REG_SIMPLE(getenv), REG_SIMPLE(perform), + /* Also registered as the global 'printc' */ REG_SIMPLE(printc), REG_SIMPLE(setenv), REG_SIMPLE(time), @@ -335,6 +336,8 @@ luaopen_loader(lua_State *L) lua_setfield(L, -2, "machine"); lua_pushstring(L, MACHINE_ARCH); lua_setfield(L, -2, "machine_arch"); + /* Set global printc to loader.printc */ + lua_register(L, "printc", lua_printc); return 1; }