input: Fix pungetc on PEOF
commit69786bc79f9bdacc7e37ae0bb226c31bb41440c3
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 9 Jun 2024 08:18:40 +0000 (9 16:18 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 16 Jun 2024 10:16:59 +0000 (16 18:16 +0800)
tree7816f2fb005d735aed770d22a4483841176c135a
parent636a856232767b1fdf2396e2073ba859924a7d7f
input: Fix pungetc on PEOF

Calling pungetc upon PEOF must cause the next pgetc call to return
PEOF.  This was broken by the multi-byte pungetc patch.  Fix it by
adding the EOF logic to pgetc.

Note that pungetn will always disregard the PEOF.

Fixes: 2c92409145d0 ("input: Allow MB_LEN_MAX calls to pungetc")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
src/input.c
src/input.h