mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Fix oops w/ array serialization ordering
This commit is contained in:
parent
727d9cbf56
commit
d37536bd4b
3 changed files with 5 additions and 5 deletions
2
third_party/lua/luaencodejsondata.c
vendored
2
third_party/lua/luaencodejsondata.c
vendored
|
@ -120,9 +120,9 @@ static int LuaEncodeJsonDataImpl(lua_State *L, char **buf, int level,
|
|||
lua_pop(L, 1); // table/-2, key/-1
|
||||
}
|
||||
// stack: table/-1, as the key was popped by lua_next
|
||||
SortStrList(&sl);
|
||||
}
|
||||
RETURN_ON_ERROR(appendw(buf, isarray ? '[' : '{'));
|
||||
SortStrList(&sl);
|
||||
RETURN_ON_ERROR(JoinStrList(&sl, buf, ','));
|
||||
FreeStrList(&sl);
|
||||
RETURN_ON_ERROR(appendw(buf, isarray ? ']' : '}'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue