diff options
author | alitor <me4all@mail.ru> | 2017-09-26 23:10:43 +0200 |
---|---|---|
committer | alitor <me4all@mail.ru> | 2017-09-26 23:10:43 +0200 |
commit | 7f0668bbc54d588b83f06043de455cb7297f7f31 (patch) | |
tree | ea96027023baa6dac426bda9cbca65264aeb3b26 /plugins/MirLua/src/mlua.cpp | |
parent | f4e6b610a79955bb75d62476d361762e17b791b3 (diff) | |
parent | 2258b1b2cf951347d167d01201f0dc4bbf9a4428 (diff) |
Merge branch 'master' of https://github.com/miranda-ng/miranda-ng
Diffstat (limited to 'plugins/MirLua/src/mlua.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index d3c835ee7d..5229196f64 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -42,6 +42,21 @@ static int mlua_print(lua_State *L) data.AppendFormat("%s", lua_tostring(L, i));
break;
default:
+ if (lua_getmetatable(L, 1))
+ {
+ if (lua_getfield(L, -1, "__tostring") == LUA_TFUNCTION)
+ {
+ lua_pushvalue(L, 1);
+ if (luaM_pcall(L, 1, 1) == LUA_OK)
+ {
+ data.AppendFormat("%s", lua_tostring(L, -1));
+ lua_pop(L, 2);
+ break;
+ }
+ lua_pop(L, 2);
+ }
+ lua_pop(L, 1);
+ }
data.AppendFormat("%s(0x%p)", luaL_typename(L, i), lua_topointer(L, i));
break;
}
|