summaryrefslogtreecommitdiff
path: root/src/util/util.c
blob: 84edd276b7abcdaa1284394a558ca8d8dd950b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <lua.h>

void append_table(lua_State *L, int tbl_a, int tbl_b)
{
	lua_pushnil(L);
	while(lua_next(L, tbl_b) != 0) {
		lua_pushvalue(L, -2); // key
		lua_pushvalue(L, -2); // value
		lua_settable(L, tbl_a);
		lua_pop(L, 1);
	}
}