chiark / gitweb /
journal: Fix navigating backwards missing entries
authorOlivier Brunel <jjk@jjacky.com>
Fri, 5 Dec 2014 15:06:45 +0000 (16:06 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 8 Dec 2014 18:38:55 +0000 (19:38 +0100)
With DIRECTION_UP (i.e. navigating backwards) in generic_array_bisect() when the
needle was found as the last item in the array, it wasn't actually processed as
match, resulting in entries being missed.

https://bugs.freedesktop.org/show_bug.cgi?id=86855

src/journal/journal-file.c

index 7858435badfd9bcb870beb3537bb242a884f2058..c5d2d19433a0aeabd0d01b5edf172be5f9cbef65 100644 (file)
@@ -1657,7 +1657,7 @@ static int generic_array_bisect(
                         }
                 }
 
-                if (k > n) {
+                if (k >= n) {
                         if (direction == DIRECTION_UP) {
                                 i = n;
                                 subtract_one = true;