Up to 8 KiB was read into a buffer and then strchr() used to test for a
linefeed. There was no guarantee the linefeed would be present, else
why test for it, nor that the buffer would contain a NUL to terminate
the search, either from the read bytes, or the bytes not trampled by
read(). Replace the two similar lumps of code with a new
linefeed_typed(). Bug pre-dates git.