journalctl: minor follow-up for --lines=

Follow-up for 8d6791d2aa

Addresses https://github.com/systemd/systemd/pull/28777#discussion_r1295790102
This commit is contained in:
Mike Yuan
2023-08-16 16:23:35 +01:00
committed by Luca Boccassi
parent 663e27564f
commit f2e2c93d0f
+2 -2
View File
@@ -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)