From: est31 Date: Fri, 12 Jun 2015 18:00:50 +0000 (+0200) Subject: dofile error reporting for syntax errors X-Git-Tag: 0.4.13~216 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=502e40a649137461947c36ea52205f058f81296f;p=oweals%2Fminetest.git dofile error reporting for syntax errors According to doc, dofile() raises an error when parsing failed due to syntax errors. Fixes #2775 --- diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp index c46483e95..6a6d40307 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -407,7 +407,8 @@ int ScriptApiSecurity::sl_g_dofile(lua_State *L) { int nret = sl_g_loadfile(L); if (nret != 1) { - return nret; + lua_error(L); + // code after this function isn't executed } int top_precall = lua_gettop(L); lua_call(L, 0, LUA_MULTRET);