From 0da96b74d5351f63630d7c7160ad9c90c446c055 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 6 Aug 2015 19:01:46 +0100 Subject: [PATCH] Slightly improve local functions output. --- src/lua/lua_logger.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lua/lua_logger.c b/src/lua/lua_logger.c index b84d1623f..f5ddb2ca7 100644 --- a/src/lua/lua_logger.c +++ b/src/lua/lua_logger.c @@ -272,7 +272,7 @@ lua_logger_out_userdata (lua_State *L, gint pos, gchar *outbuf, gsize len) { gint r; - if (!lua_getmetatable (L, pos) || len == 0) { + if (!lua_getmetatable (L, pos)) { return 0; } @@ -399,6 +399,9 @@ lua_logger_out_type (lua_State *L, gint pos, gchar *outbuf, gsize len) case LUA_TUSERDATA: r = lua_logger_out_userdata (L, pos, outbuf, len); break; + case LUA_TFUNCTION: + r = rspamd_snprintf (outbuf, len + 1, "function"); + break; default: /* Try to push everything as string using tostring magic */ r = lua_logger_out_str (L, pos, outbuf, len); -- 2.39.5