projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b187ed
)
dofile error reporting for syntax errors
author
est31
<MTest31@outlook.com>
Fri, 12 Jun 2015 18:00:50 +0000
(20:00 +0200)
committer
est31
<MTest31@outlook.com>
Fri, 12 Jun 2015 18:23:31 +0000
(20:23 +0200)
According to doc, dofile() raises an error when parsing failed due to syntax errors.
Fixes #2775
src/script/cpp_api/s_security.cpp
patch
|
blob
|
history
diff --git
a/src/script/cpp_api/s_security.cpp
b/src/script/cpp_api/s_security.cpp
index c46483e95450cf2b68c1ad31f3eefdecf802c3d5..6a6d4030757b82bbf1361bba4cf8c64b17c5d986 100644
(file)
--- 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);