From 6cebe83cfa656365348ff21f567d133c7e34a71d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 25 Dec 2013 19:17:10 +0100 Subject: [PATCH] Revert "journalctl: remove unexpected behavior of journalctl -b" This reverts commit cf5bccc2bb9569030cb04debbc4208aaca0fe5b4. We should fix thinks properly if they aren't perfect, not just break other things... --- src/journal/journalctl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index b347dfa18..cb252eb0b 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -371,7 +371,18 @@ static int parse_argv(int argc, char *argv[]) { case 'b': arg_boot = true; - arg_boot_descriptor = optarg; + + if (optarg) + arg_boot_descriptor = optarg; + else if (optind < argc) { + int boot; + + if (argv[optind][0] != '-' || + safe_atoi(argv[optind], &boot) >= 0) { + arg_boot_descriptor = argv[optind]; + optind++; + } + } break; -- 2.30.2