Skip to content

Commit

Permalink
Fix minetest.request_insecure_environment() always returning nil
Browse files Browse the repository at this point in the history
Fixes #3765
  • Loading branch information
Jeija authored and est31 committed Feb 26, 2016
1 parent f9d7277 commit 033a510
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/script/lua_api/l_util.cpp
Expand Up @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "cpp_api/s_security.h"
#include "areastore.h"
#include "porting.h"
#include "debug.h"
#include "log.h"
#include "tool.h"
#include "filesys.h"
Expand Down Expand Up @@ -372,8 +373,8 @@ int ModApiUtil::l_request_insecure_environment(lua_State *L)
if (lua_getstack(L, 2, &info)) {
return 0;
}
assert(lua_getstack(L, 1, &info));
assert(lua_getinfo(L, "S", &info));
FATAL_ERROR_IF(!lua_getstack(L, 1, &info), "lua_getstack() failed");
FATAL_ERROR_IF(!lua_getinfo(L, "S", &info), "lua_getinfo() failed");
// ...and that that item is the main file scope.
if (strcmp(info.what, "main") != 0) {
return 0;
Expand Down

0 comments on commit 033a510

Please sign in to comment.