1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

LibCore: Fix relative seeking in IODevice

The recently introduced read buffer in IODevice broke relative seeking.
The amount of data in the buffer wouldn't get taken into account.
This commit is contained in:
Arne Elster 2021-11-29 19:56:29 +01:00 committed by Andreas Kling
parent b818d4c7e3
commit cdaa179eeb
4 changed files with 35 additions and 1 deletions

View file

@ -245,6 +245,7 @@ bool IODevice::seek(i64 offset, SeekMode mode, off_t* pos)
break;
case SeekMode::FromCurrentPosition:
m = SEEK_CUR;
offset -= m_buffered_data.size();
break;
case SeekMode::FromEndPosition:
m = SEEK_END;