From: Dave Reisner Date: Wed, 25 Dec 2013 17:24:19 +0000 (-0500) Subject: journalctl: remove unexpected behavior of journalctl -b X-Git-Tag: v209~648 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=cf5bccc2bb9569030cb04debbc4208aaca0fe5b4;hp=0ce036ce7fa040410fda6baceaceb43989a1de0c 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. --- 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;