diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
commit | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch) | |
tree | 729bbcb92231538fa61dab6c3d890b025484b7f5 /src/cjson/lua_cjson.c | |
parent | 376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff) | |
parent | 28c04948a1c887a1cc0cb64de79fa32631700466 (diff) | |
download | rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2 rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'src/cjson/lua_cjson.c')
-rw-r--r-- | src/cjson/lua_cjson.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/cjson/lua_cjson.c b/src/cjson/lua_cjson.c index 6af43d8eb7..254355e5a2 100644 --- a/src/cjson/lua_cjson.c +++ b/src/cjson/lua_cjson.c @@ -174,9 +174,9 @@ typedef struct { typedef struct { /* convert null in json objects to lua nil instead of vim.NIL */ - int luanil_object; + bool luanil_object; /* convert null in json arrays to lua nil instead of vim.NIL */ - int luanil_array; + bool luanil_array; } json_options_t; typedef struct { @@ -1453,15 +1453,11 @@ static int json_decode(lua_State *l) luaL_checktype(l, -1, LUA_TTABLE); lua_getfield(l, -1, "object"); - if (!lua_isnil(l, -1)) { - options.luanil_object = true; - } + options.luanil_object = lua_toboolean(l, -1); lua_pop(l, 1); lua_getfield(l, -1, "array"); - if (!lua_isnil(l, -1)) { - options.luanil_array = true; - } + options.luanil_array = lua_toboolean(l, -1); /* Also pop the luanil table */ lua_pop(l, 2); break; |