From f2e2c93d0f2855759468664b9d46f9e43e42a593 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 16 Aug 2023 20:35:15 +0800 Subject: [PATCH] journalctl: minor follow-up for --lines= Follow-up for 8d6791d2aa98c989101f572278e9b0a63edfec42 Addresses https://github.com/systemd/systemd/pull/28777#discussion_r1295790102 --- src/journal/journalctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index a4e34fa0b12..f1c19af1b26 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -95,7 +95,7 @@ static bool arg_full = true; static bool arg_all = false; static PagerFlags arg_pager_flags = 0; static int arg_lines = ARG_LINES_DEFAULT; -static int arg_lines_oldest = false; +static bool arg_lines_oldest = false; static bool arg_no_tail = false; static bool arg_truncate_newline = false; static bool arg_quiet = false; @@ -631,7 +631,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'n': - r = parse_lines(optarg ?: optind < argc ? argv[optind] : NULL, !optarg); + r = parse_lines(optarg ?: argv[optind], !optarg); if (r < 0) return r; if (r > 0 && !optarg) -- 2.47.3