From 89aca2d0a0f1b9a28149b6c1640a7e73feef5b39 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 20 Mar 2015 11:02:23 +0000 Subject: 34752: another fix for history expansion in cmd subst --- Src/input.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/input.c b/Src/input.c index 92b1ad1f7..30970a060 100644 --- a/Src/input.c +++ b/Src/input.c @@ -571,8 +571,20 @@ inpoptop(void) { if (!lexstop) { inbufflags &= ~INP_ALCONT; - while (inbufptr > inbuf) - inungetc(inbufptr[-1]); + while (inbufptr > inbuf) { + inbufptr--; + inbufct++; + inbufleft++; + /* + * As elsewhere in input and history mechanisms: + * unwinding aliases and unwinding history have different + * implications as aliases are after the lexer while + * history is before, but they're both pushed onto + * the input stack. + */ + if ((inbufflags & (INP_ALIAS|INP_HIST)) == INP_ALIAS) + zshlex_raw_back(); + } } if (inbuf && (inbufflags & INP_FREE)) -- cgit 1.4.1