From: Lennart Poettering Date: Wed, 25 Dec 2013 18:17:10 +0000 (+0100) Subject: Revert "journalctl: remove unexpected behavior of journalctl -b" X-Git-Tag: v209~644 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=6cebe83cfa656365348ff21f567d133c7e34a71d;hp=43a99a7afe3063eebc901452026b13360b69a7b5 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... --- 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;