input: Move newline loop into preadbuffer
commita065467315dc5f2f312f7e6f1d2e9d05a77b3cb7
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 2 Jun 2024 01:31:32 +0000 (2 09:31 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 8 Jun 2024 03:43:51 +0000 (8 11:43 +0800)
treef3b625ae051eda86da232d1db78a5fa33c04ebea
parentb12f136cc7042c5dfbd552e4307a57238e027c38
input: Move newline loop into preadbuffer

As it stands preadfd tries to fetch a whole line when we're reading
one byte at a time.  However, this is wrong because how many bytes
we're trying to read has nothing to do with whether we get a whole
line or not.

Move the loop into preadbuffer alongside the other history support
code.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
src/input.c