mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibCore: IODevice::can_read_line() should succeed for newline-less file
If the first call to populate_read_buffer() hits EOF but something did get buffered, we can indeed read a line.
This commit is contained in:
parent
212aa85a55
commit
387607503c
Notes:
sideshowbarker
2024-07-19 01:44:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/387607503ce
1 changed files with 2 additions and 0 deletions
|
@ -130,6 +130,8 @@ bool IODevice::can_read_line() const
|
|||
if (!can_read_from_fd())
|
||||
return false;
|
||||
populate_read_buffer();
|
||||
if (m_eof && !m_buffered_data.is_empty())
|
||||
return true;
|
||||
return m_buffered_data.contains_slow('\n');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue