From: Frantisek Sumsal Date: Mon, 14 Mar 2022 17:16:15 +0000 (+0100) Subject: journal: reset previously set JSON flags X-Git-Tag: v251-rc1~146^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faf20d4cca04cb9d08d098d4d9748e493648703b;p=thirdparty%2Fsystemd.git journal: reset previously set JSON flags Make sure we reset the JSON format flags if the format option is used multiple times, e.g. `journalctl -o json-format -o export`. Pointed out in: https://github.com/systemd/systemd/pull/22721#discussion_r826018985 Follow-up for: 5a1355d848a0f6564a04c6d8268e72bc93d173de --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 4e3d17678e0..e0951f9682e 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -581,6 +581,9 @@ static int parse_argv(int argc, char *argv[]) { if (OUTPUT_MODE_IS_JSON(arg_output)) arg_json_format_flags = output_mode_to_json_format_flags(arg_output) | JSON_FORMAT_COLOR_AUTO; + else + arg_json_format_flags = JSON_FORMAT_OFF; + break; case 'l':