From f8059d931ecfc6d8eca2b371ad587f9485c4bccf Mon Sep 17 00:00:00 2001 From: batrick Date: Thu, 31 Jul 2008 07:30:39 +0000 Subject: [PATCH] [NSE] Added an error check for loading a file. --- nse_init.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nse_init.cc b/nse_init.cc index 0fd051c2f..ffd5b9c93 100644 --- a/nse_init.cc +++ b/nse_init.cc @@ -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);