From c3ce6202ec0097f918d2e3e3f036b28c25813385 Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Fri, 5 Dec 2014 16:06:45 +0100 Subject: [PATCH] journal: Fix navigating backwards missing entries 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 (cherry picked from commit 2173cbf847fc53ca24950e77958c902edecfc207) --- src/journal/journal-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 8a2c0fcac..9de3ddde4 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -1657,7 +1657,7 @@ static int generic_array_bisect( } } - if (k > n) { + if (k >= n) { if (direction == DIRECTION_UP) { i = n; subtract_one = true;