mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
journalctl: fix when --grep is used with --follow
Follow-up for #25147 (db4691961c)
--follow sets arg_lines to 10, which breaks
--grep as the latter implies --reverse.
So let's not set --reverse if --follow is used.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
957b934f82
commit
c673fd52e0
@@ -1086,8 +1086,10 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
return r;
|
||||
|
||||
/* When --grep is used along with --lines, we don't know how many lines we can print.
|
||||
* So we search backwards and count until enough lines have been printed or we hit the head. */
|
||||
if (arg_lines >= 0)
|
||||
* So we search backwards and count until enough lines have been printed or we hit the head.
|
||||
* An exception is that --follow might set arg_lines, so let's not imply --reverse
|
||||
* if that is specified. */
|
||||
if (arg_lines >= 0 && !arg_follow)
|
||||
arg_reverse = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user