Lua: make chunk:mark() call string.format()

This commit is contained in:
Přemysl Eric Janouch 2017-01-17 16:22:30 +01:00
parent 0f96cc9b9f
commit 45a73ff68e
Signed by: p
GPG Key ID: B715679E3A361BE6

6
hex.c
View File

@ -1006,7 +1006,11 @@ static int
app_lua_chunk_mark (lua_State *L)
{
struct app_lua_chunk *self = luaL_checkudata (L, 1, XLUA_CHUNK_METATABLE);
app_lua_mark (self->offset, self->len, luaL_checkstring (L, 2));
int n_args = lua_gettop (L);
lua_rawgeti (L, LUA_REGISTRYINDEX, g_ctx.ref_format);
lua_insert (L, 2);
lua_call (L, n_args - 1, 1);
app_lua_mark (self->offset, self->len, luaL_checkstring (L, -1));
return 0;
}