input: Allow two consecutive calls to pungetc
commit17db43b5841504b694203952fb0e82246c06a97f
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 5 Jan 2015 11:50:57 +0000 (5 22:50 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 5 Jan 2015 11:58:52 +0000 (5 22:58 +1100)
treec6b969c60bb9b1ddefc89e6ec1369d88d75dcfbc
parent51781428ead9a2142795764d0c42abfd9bb47171
input: Allow two consecutive calls to pungetc

The commit ef91d3d6a4c39421fd3a391e02cd82f9f3aee4a8 ([PARSER]
Handle backslash newlines properly after dollar sign) created
cases where we make two consecutive calls to pungetc.  As we
don't explicitly support that there are corner cases where you
end up with garbage input leading to undefined behaviour.

This patch adds explicit support for two consecutive calls to
pungetc.

Reported-by: Jilles Tjoelker <jilles@stack.nl>
Reported-by: Juergen Daubert <jue@jue.li>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
src/input.c
src/input.h