Set print and xpcall to locals in main.c's lua code

This prevents any undesired behaviour from those functions being set to
something else, such as lua errors not being printed to the console if
the global print() function was changed.
This commit is contained in:
rxi
2014-06-18 19:02:47 +01:00
parent 3ddcbd954d
commit e725a3f335

View File

@@ -54,6 +54,8 @@ int main(void) {
int res = luaL_dostring(L,
"package.path = package.path .. ';' .."
"package.path:gsub('%?', 'lua/?')\n"
"local print = print\n"
"local xpcall = xpcall\n"
"require 'main'\n"
"if not love.run then\n"
"function love.run()\n"