less: less <HUGEFILE + [End] busy loops, fix it

This commit is contained in:
Denis Vlasenko 2007-05-31 23:55:39 +00:00
parent 342b0ab945
commit fdcfa2aba7

View File

@ -347,8 +347,10 @@ static void read_lines(void)
} else { } else {
flines[max_fline] = xrealloc(current_line, strlen(current_line)+1); flines[max_fline] = xrealloc(current_line, strlen(current_line)+1);
} }
if (max_fline >= MAXLINES) if (max_fline >= MAXLINES) {
eof_error = 0; /* Pretend we saw EOF */
break; break;
}
if (max_fline > cur_fline + max_displayed_line) if (max_fline > cur_fline + max_displayed_line)
break; break;
if (eof_error <= 0) { if (eof_error <= 0) {