From cf5bccc2bb9569030cb04debbc4208aaca0fe5b4 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 25 Dec 2013 12:24:19 -0500 Subject: [PATCH] journalctl: remove unexpected behavior of journalctl -b This flag shouldn't try and consume the following argument. It should behave like every other flag which takes an optional argument when parsed by getopt_long. --- src/journal/journalctl.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index cb252eb0b..b347dfa18 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -371,18 +371,7 @@ static int parse_argv(int argc, char *argv[]) { case 'b': arg_boot = true; - - 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++; - } - } + arg_boot_descriptor = optarg; break; -- 2.30.2