From e725a3f33530435e950493ede9375542487da151 Mon Sep 17 00:00:00 2001 From: rxi Date: Wed, 18 Jun 2014 19:02:47 +0100 Subject: [PATCH] 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. --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.c b/src/main.c index 7e4ccde..3ade310 100644 --- a/src/main.c +++ b/src/main.c @@ -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"