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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user