fix peeking

This commit is contained in:
Florian Stinglmayr 2025-05-02 13:12:02 +02:00
parent 6dbff67bee
commit ca2b771d27

View File

@ -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);