[systemd-commits] src/journal

Dave Reisner dreisner at kemper.freedesktop.org
Wed Dec 25 09:40:21 PST 2013


 src/journal/journalctl.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

New commits:
commit cf5bccc2bb9569030cb04debbc4208aaca0fe5b4
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Wed Dec 25 12:24:19 2013 -0500

    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 cb252eb..b347dfa 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;
 



More information about the systemd-commits mailing list