Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Mar 2018 15:46:22 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330282 - head/stand/liblua
Message-ID:  <201803021546.w22FkMbY061569@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Fri Mar  2 15:46:22 2018
New Revision: 330282
URL: https://svnweb.freebsd.org/changeset/base/330282

Log:
  lualoader: Register loader.printc as global printc

Modified:
  head/stand/liblua/lutils.c

Modified: head/stand/liblua/lutils.c
==============================================================================
--- head/stand/liblua/lutils.c	Fri Mar  2 15:28:08 2018	(r330281)
+++ head/stand/liblua/lutils.c	Fri Mar  2 15:46:22 2018	(r330282)
@@ -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;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803021546.w22FkMbY061569>