diff options
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r-- | src/journal/journalctl.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index b347dfa187..cb252eb0b8 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; |