diff --git a/lib/src/journal/file.c b/lib/src/journal/file.c index c4cce47..9cc0c83 100644 --- a/lib/src/journal/file.c +++ b/lib/src/journal/file.c @@ -362,9 +362,9 @@ static EDErrorCode ed_journal_file_read_last_(EDJournalFile *self) while (TRUE) { /* arbitrary */ - pos = end - 100; + pos = (pos - 100); if (pos <= 0) { - break; + pos = 0; } if (!g_seekable_seek(G_SEEKABLE(stream), pos, G_SEEK_SET, @@ -398,7 +398,11 @@ static EDErrorCode ed_journal_file_read_last_(EDJournalFile *self) } while (TRUE); if (last == NULL) { - goto done; + if (pos <= 0) { + goto done; + } else { + continue; + } } entry = ed_journal_entry_new_parse(last, NULL);