summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-27 00:58:39 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-27 00:58:39 +0100
commite5462cd80e5328a769137c261c93931ea0c27bab (patch)
tree159babd9fb59ece880f742aac497ed59670f7f02
parentf268980d2cee694fa4118a71402a47c316af0425 (diff)
journal: fix iteration when we go backwards from the beginning of an array chain element
-rw-r--r--src/journal/journal-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 27cd16fc00..409be76dd4 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1687,7 +1687,7 @@ found:
return 0;
/* Let's cache this item for the next invocation */
- chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, i + (subtract_one ? -1 : 0));
+ chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, subtract_one ? (i > 0 ? i-1 : (uint64_t) -1) : i);
if (subtract_one && i == 0)
p = last_p;