18941: history wrong after parse error during alias expansion

This commit is contained in:
Peter Stephenson 2003-08-11 13:19:48 +00:00
parent b38f3c9a17
commit e65a811520
3 changed files with 19 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2003-08-11 Peter Stephenson <pws@csr.com>
* 18941: Src/hist.c, Src/input.c: Alias text could end up in
history after a parsing error during alias expansion.
* 18938: Src/lex.c, Src/Math.c, Src/Zle/zle_main.c,
Src/Zle/compcore.c: Mark some data symbols for export, shutting
up Cygwin's dllwrap. Note that c from zle_main.c is not marked

View File

@ -290,6 +290,8 @@ safeinungetc(int c)
void
herrflush(void)
{
inpopalias();
while (!lexstop && inbufct && !strin)
hwaddc(ingetc());
}

View File

@ -549,3 +549,17 @@ inpop(void)
inpoptop();
} while (remcont);
}
/*
* Expunge any aliases from the input stack; they shouldn't appear
* in the history and need to be flushed explicitly when we encounter
* an error.
*/
/**/
void
inpopalias(void)
{
while (inbufflags & INP_ALIAS)
inpoptop();
}