From: Mike Yuan Date: Wed, 16 Aug 2023 12:35:15 +0000 (+0800) Subject: journalctl: minor follow-up for --lines= X-Git-Tag: v255-rc1~707 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2e2c93d0f2855759468664b9d46f9e43e42a593;p=thirdparty%2Fsystemd.git journalctl: minor follow-up for --lines= Follow-up for 8d6791d2aa98c989101f572278e9b0a63edfec42 Addresses https://github.com/systemd/systemd/pull/28777#discussion_r1295790102 --- 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)