From: Vsevolod Stakhov Date: Thu, 6 Aug 2015 18:01:46 +0000 (+0100) Subject: Slightly improve local functions output. X-Git-Tag: 1.0.0~221 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0da96b74d5351f63630d7c7160ad9c90c446c055;p=thirdparty%2Frspamd.git Slightly improve local functions output. --- diff --git a/src/lua/lua_logger.c b/src/lua/lua_logger.c index b84d1623fe..f5ddb2ca7c 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);