diff options
author | roman65536 <roman65536@yahoo.com> | 2017-03-16 10:27:18 +0100 |
---|---|---|
committer | roman65536 <roman65536@yahoo.com> | 2017-03-16 10:27:18 +0100 |
commit | 75ab57d1fe52c56ab7df8ada9393a9dcc3f975c2 (patch) | |
tree | be2f40be52e7007a6216cdc281ac49ddd6f653cd | |
parent | c2cd0390e12193fb34b334cde22a4336d1ca4c6c (diff) |
Fixed segv @load due to not founding the init.lua file
-rw-r--r-- | src/lua.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -267,10 +267,14 @@ void doLuainit() { luaL_register(L, "sc", sclib); + if (luaL_loadfile(L, "init.lua")) /* Load but don't run the Lua script */ - bail(L, "luaL_loadfile() failed"); /* Error out if file can't be read */ + { + fprintf(stderr, "\nWarning :\n Couldn't load init.lua: %s\n\n", lua_tostring(L,-1)); + return; + } if (lua_pcall(L, 0, 0, 0)) /* PRIMING RUN. FORGET THIS AND YOU'RE TOAST */ - bail(L, "lua_pcall() failed"); /* Error out if Lua file has an error */ + fprintf(stderr, "\nFATAL ERROR:\n Couldn't initialized Lua: %s\n\n", lua_tostring(L,-1)); return; } |