1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-10 07:26:34 +00:00

[NSE] Added an error check for loading a file.

This commit is contained in:
batrick
2008-07-31 07:30:39 +00:00
parent e198b0fa4a
commit f8059d931e

View File

@@ -365,7 +365,8 @@ int init_updatedb (lua_State *L)
lua_newtable(L); // script environment
lua_pushvalue(L, -3); // script metatable
lua_setmetatable(L, -2); // set it
luaL_loadfile(L, file); // load file
if (luaL_loadfile(L, file) != 0) // load file
luaL_error(L, "file '%s' could not be loaded", file);
lua_pushvalue(L, -2); // push environment
lua_setfenv(L, -2); // set it
lua_call(L, 0, 0);