Skip to contentSkip to conversation

ungetc is not cleared on error?

PATCH New Denys Vlasenko 2 participants 2 messages Dec 19, 2020 – Dec 23, 2020

lore
Share & tools
lore
#0 lore raw

Current git:

$ ;l
dash: 1: Syntax error: ";" unexpected
$ s
COPYING    ChangeLog.O    Makefile.am  aclocal.m4  autom4te.cache
config.h     config.log     configure       dash
dollar_altvalue1.tests  missing  stamp-h1
ChangeLog  Makefile    Makefile.in  autogen.sh  compile
config.h.in  config.status  configure.ac  depcomp  install-sh
  src      trace
#1 lore raw

PATCH 1/1 input: Clear unget on RESET

Quoted 11 lines · Denys Vlasenko

Current git:

$ ;l
dash: 1: Syntax error: ";" unexpected
$ s
COPYING    ChangeLog.O    Makefile.am  aclocal.m4  autom4te.cache
config.h     config.log     configure       dash
dollar_altvalue1.tests  missing  stamp-h1
ChangeLog  Makefile    Makefile.in  autogen.sh  compile
config.h.in  config.status  configure.ac  depcomp  install-sh
  src      trace

This patch fixes it by clearing ungetc on RESET.

Fixes 17db43b58415 ("input: Allow two consecutive calls to pungetc")
src/input.c +1 -0
index 4987732..d7c101b 100644
@@ -87,6 +87,7 @@ INIT {
 RESET {
 	/* clear input buffer */
 	basepf.lleft = basepf.nleft = 0;
+	basepf.unget = 0;
 	popallfiles();
 }
 
Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt