mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
more progress on lua-cjson bundling. it now works on Mac OS X, FreeBSD, and Linux, at least.
This commit is contained in:
13
patches/lua_cjson-1.0.2-array_detection_fix.patch
Normal file
13
patches/lua_cjson-1.0.2-array_detection_fix.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/lua_cjson.c b/lua_cjson.c
|
||||
index 4b1915a..b46e915 100644
|
||||
--- a/lua_cjson.c
|
||||
+++ b/lua_cjson.c
|
||||
@@ -501,7 +501,7 @@ static int lua_array_length(lua_State *l, json_config_t *cfg)
|
||||
/* table, startkey */
|
||||
while (lua_next(l, -2) != 0) {
|
||||
/* table, key, value */
|
||||
- if (lua_isnumber(l, -2) &&
|
||||
+ if (lua_type(l, -2) == LUA_TNUMBER &&
|
||||
(k = lua_tonumber(l, -2))) {
|
||||
/* Integer >= 1 ? */
|
||||
if (floor(k) == k && k >= 1) {
|
Reference in New Issue
Block a user