mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
f03e452085
When we flush a FILE, we behave differently depending on whether we reading from the file or writing to it: * If we're writing, we actually write out the buffered data. * If we're reading, we just drop the buffered (read ahead) data. After flushing, there should be no additional buffered state stdio keeps about a FILE, compared to what is true about the underlying file. This includes file position (offset). When flushing writes, this is taken care of automatically, but dropping the buffer is not enough to achieve that when reading. This commit fixes that by seeking back explicitly in that case. One way the problem manifested itself was upon fseek(SEEK_CUR) calls, as the position of the underlying file was oftentimes different to the logical position of the FILE. Since FILE::seek() already calls FILE::flush() prior to actually modifying the position, fixing FILE::flush() to sync the positions is enough to fix that issue. |
||
---|---|---|
.. | ||
LibAudio | ||
LibC | ||
LibCore | ||
LibCrypto | ||
LibDebug | ||
LibDesktop | ||
LibELF | ||
LibGemini | ||
LibGfx | ||
LibGUI | ||
LibHTTP | ||
LibIPC | ||
LibJS | ||
LibLine | ||
LibM | ||
LibMarkdown | ||
LibPCIDB | ||
LibProtocol | ||
LibPthread | ||
LibTextCodec | ||
LibThread | ||
LibTLS | ||
LibUnwind | ||
LibVT | ||
LibWeb | ||
LibX86 | ||
CMakeLists.txt |