]> git.ipfire.org Git - thirdparty/systemd.git/commit
journalctl: fix output when --until is used with --lines
authorMike Yuan <me@yhndnzj.com>
Sat, 4 Mar 2023 11:06:00 +0000 (19:06 +0800)
committerMike Yuan <me@yhndnzj.com>
Sun, 5 Mar 2023 03:53:03 +0000 (11:53 +0800)
commit81fb5375b3b3bfc22d023d7908ad9eee4b3c1ffb
treef005bd203f944c157b6c86b2950aba0a6f50d20d
parent561f17a1e45d631953f18af7f0ef7ef2e6666fa5
journalctl: fix output when --until is used with --lines

Before this commit, when --lines is specified, we jump to the tail and
search afterwards from there, thus breaking --until if used together.

After this commit:
If both --until and any of --reverse and --lines is specified, things get
a little tricky. We seek to the place of --until first. If only --reverse or
--reverse and --lines is specified, we search backwards and let the output
counter handle --lines for us. If only --lines is used, we just jump backwards
arg_lines and search afterwards from there.
src/journal/journalctl.c