summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2021-04-21 12:17:55 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2021-04-23 12:25:40 +0200
commit09e3c0c855e339216784a1d43715c3ae2d79ec23 (patch)
treeeae37641a9cc6d7416dc5fb7bdd06a5851e0c48a /apt-private
parent57b727af4e1eea4ea118ca5e5028fa7ce86fb538 (diff)
json: Actually pop states
The JSON encoder only looked at the top state, but did not pop it, so if we nested objects, we got stuck in whatever the last state we pushed aside was, so in our example, we wrongly get a comma inserted _after_ key "b": {"a":[{}], "b":,[{}] }
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-json-hooks.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/apt-private/private-json-hooks.cc b/apt-private/private-json-hooks.cc
index b61829cbf..ce1665b18 100644
--- a/apt-private/private-json-hooks.cc
+++ b/apt-private/private-json-hooks.cc
@@ -79,6 +79,7 @@ class APT_HIDDEN JsonWriter
void popState()
{
this->state = old_states.top();
+ old_states.pop();
}
public: