mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Fix secure io.lines
It used to drop all of the return values from the insecure version of the function.
This commit is contained in:
parent
9e10f9f49a
commit
3af5eef964
@ -577,13 +577,13 @@ int ScriptApiSecurity::sl_io_lines(lua_State *L)
|
||||
CHECK_SECURE_PATH(L, path);
|
||||
}
|
||||
|
||||
int top_precall = lua_gettop(L);
|
||||
push_original(L, "io", "lines");
|
||||
lua_pushvalue(L, 1);
|
||||
int top_precall = lua_gettop(L);
|
||||
lua_call(L, 1, LUA_MULTRET);
|
||||
// Return number of arguments returned by the function,
|
||||
// adjusting for the function being poped.
|
||||
return lua_gettop(L) - (top_precall - 1);
|
||||
return lua_gettop(L) - top_precall;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user