From 2024f63f774be32abcf8992f4dc28754990558a1 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Sat, 3 Feb 2024 21:49:48 +0100 Subject: [PATCH] The "Fix hex literals in json output" broke save mode, restore it Signed-off-by: Jozsef Kadlecsik --- lib/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/session.c b/lib/session.c index a856614d..f8222883 100644 --- a/lib/session.c +++ b/lib/session.c @@ -2284,7 +2284,8 @@ ipset_cmd(struct ipset_session *session, enum ipset_cmd cmd, uint32_t lineno) if (cmd == IPSET_CMD_LIST || cmd == IPSET_CMD_SAVE) { /* Set default output mode */ if (session->mode == IPSET_LIST_NONE) - session->mode = IPSET_LIST_PLAIN; + session->mode = cmd == IPSET_CMD_LIST ? + IPSET_LIST_PLAIN : IPSET_LIST_SAVE; /* Reset just in case there are multiple modes in a session */ ipset_envopt_unset(session, IPSET_ENV_QUOTED); switch (session->mode) { -- 2.47.3