From 4932221e81ccb89f1ac2acde300c1e9efb988f8a Mon Sep 17 00:00:00 2001
From: Alexander Lantsev <aunsane@gmail.com>
Date: Wed, 10 Feb 2016 07:40:46 +0000
Subject: MirLua: fixed parsing of nested tables

git-svn-id: http://svn.miranda-ng.org/main/trunk@16259 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 plugins/MirLua/Modules/JSON/src/metatable.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'plugins/MirLua/Modules')

diff --git a/plugins/MirLua/Modules/JSON/src/metatable.cpp b/plugins/MirLua/Modules/JSON/src/metatable.cpp
index 2854a5c888..7d66533aff 100644
--- a/plugins/MirLua/Modules/JSON/src/metatable.cpp
+++ b/plugins/MirLua/Modules/JSON/src/metatable.cpp
@@ -2,6 +2,7 @@
 
 void table2json(lua_State *L, int idx, JSONNode &node)
 {
+	idx = lua_absindex(L, idx);
 	lua_pushnil(L);
 	while (lua_next(L, idx) != 0) 
 	{
@@ -22,8 +23,8 @@ void table2json(lua_State *L, int idx, JSONNode &node)
 		case LUA_TNIL:
 			nnode.nullify();
 			break;
-		//case LUA_TTABLE:
-		//	table2json(L, -1, nnode);
+		case LUA_TTABLE:
+			table2json(L, -1, nnode);
 		}
 		node << nnode;
 		lua_pop(L, 1);
-- 
cgit v1.2.3