The input_line() function
gets a string of characters from the file designated by fp
and stores them in the array pointed to by buf. The
input_line() function stops reading characters when:

end-of-file is reached

a newline character is read

bufsize - 1 characters have been read.

In addition, the input_line() function buffers the last
_input_line_max lines internally. The _input_line_max
variable is defined in <stdio.h>.
You can set it before calling
input_line() for the first time; its default value is 20.
While the line is
being read, the KEY_UP and KEY_DOWN
keys can be used to move to the previous and next line respectively
in a circular buffer of previously read lines. The newline
character (\n) is replaced with the null character
on input.