less: Properly stop on EOF

This commit is contained in:
demostanis 2022-09-06 20:46:13 +02:00 committed by Sam Atkins
parent e1edd620ee
commit 505910aea1
Notes: sideshowbarker 2024-07-17 06:34:29 +09:00

View File

@ -324,7 +324,7 @@ private:
void read_enough_for_line(size_t line)
{
// This might read a bounded number of extra lines.
while (m_lines.size() < line + m_height - 1) {
while (m_lines.size() < line + m_height) {
if (!read_line())
break;
}