aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-01-17 16:22:30 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2017-01-17 16:22:30 +0100
commit45a73ff68eccd5fc9a3d8ab29b33bee90c9b1e5c (patch)
tree51579e7b72dea9608eb406952c5f639eaab735d3
parent0f96cc9b9f3d82f80e435d69d95a2ca1798021c7 (diff)
downloadhex-45a73ff68eccd5fc9a3d8ab29b33bee90c9b1e5c.tar.gz
hex-45a73ff68eccd5fc9a3d8ab29b33bee90c9b1e5c.tar.xz
hex-45a73ff68eccd5fc9a3d8ab29b33bee90c9b1e5c.zip
Lua: make chunk:mark() call string.format()
-rw-r--r--hex.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hex.c b/hex.c
index 5688085..992fc72 100644
--- a/hex.c
+++ b/hex.c
@@ -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;
}