diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-01-17 16:22:30 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-01-17 16:22:30 +0100 |
commit | 45a73ff68eccd5fc9a3d8ab29b33bee90c9b1e5c (patch) | |
tree | 51579e7b72dea9608eb406952c5f639eaab735d3 | |
parent | 0f96cc9b9f3d82f80e435d69d95a2ca1798021c7 (diff) | |
download | hex-45a73ff68eccd5fc9a3d8ab29b33bee90c9b1e5c.tar.gz hex-45a73ff68eccd5fc9a3d8ab29b33bee90c9b1e5c.tar.xz hex-45a73ff68eccd5fc9a3d8ab29b33bee90c9b1e5c.zip |
Lua: make chunk:mark() call string.format()
-rw-r--r-- | hex.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; } |