diff options
Diffstat (limited to 'src/wrapper.c')
-rw-r--r-- | src/wrapper.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/wrapper.c b/src/wrapper.c index d4f1412..3d11e01 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -54,11 +54,11 @@ main(int argc, char **argv) /* Perform pre-lua-interpreter initialisation */ #ifndef TESTING_SUPPLE - unsetenv(LUA_PATH); - unsetenv(LUA_CPATH); + unsetenv("LUA_PATH"); + unsetenv("LUA_CPATH"); unsetenv("SUPPLE_MKDTEMP"); #endif - unsetenv(LUA_INIT); + unsetenv("LUA_INIT"); L = luaL_newstate(); if (L == NULL) { @@ -67,7 +67,10 @@ main(int argc, char **argv) parg.retcode = 0; - success = lua_cpcall(L, &protected_main, &parg); + lua_pushcclosure(L, &protected_main, 0); + lua_pushlightuserdata(L, &parg); + + success = lua_pcall(L, -1, 0, 0); if (success != 0) { size_t l; |