# HG changeset patch # User jbe # Date 1473536099 -7200 # Node ID 43a4b74b5b187aef5c811f91a94016645cf11d67 # Parent b9bae84cc7a9b2b4ac46ceb32c753ef515634753 Bugfix in JSON library: length of array is an integer, not a float (Lua 5.3 distinguishes them) diff -r b9bae84cc7a9 -r 43a4b74b5b18 libraries/json/json.c --- a/libraries/json/json.c Sat Sep 10 21:24:30 2016 +0200 +++ b/libraries/json/json.c Sat Sep 10 21:34:59 2016 +0200 @@ -877,7 +877,11 @@ // pop nil from stack if no shadow table has been found: if (lua_isnil(L, -1)) lua_pop(L, 1); // return length of argument or shadow table: +#if LUA_VERSION_NUM >= 503 + lua_pushinteger(L, lua_rawlen(L, -1)); +#else lua_pushnumber(L, lua_rawlen(L, -1)); +#endif return 1; }