From f48457a695eef49fc3fb5571f73cc045bc7323cf Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 19 Mar 2015 11:10:49 +0000 Subject: 34742: history expansion inside command substitution failed. Needs the case of alias expansion separating out. --- Src/hist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Src/hist.c') diff --git a/Src/hist.c b/Src/hist.c index aa07ce875..b7ef52230 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -338,7 +338,8 @@ ihwaddc(int c) * fashion as we never need the expansion in the history * line, only in the lexer and above. */ - !((histactive & HA_INWORD) && (inbufflags & INP_ALIAS))) { + !((histactive & HA_INWORD) && + (inbufflags & (INP_ALIAS|INP_HIST)) == INP_ALIAS)) { /* Quote un-expanded bangs in the history line. */ if (c == bangchar && stophist < 2 && qbang) /* If qbang is not set, we do not escape this bangchar as it's * @@ -901,7 +902,8 @@ ihungetc(int c) zlemetall--; exlast++; } - if (!(histactive & HA_INWORD) || !(inbufflags & INP_ALIAS)) { + if (!(histactive & HA_INWORD) || + (inbufflags & (INP_ALIAS|INP_HIST)) != INP_ALIAS) { DPUTS(hptr <= chline, "BUG: hungetc attempted at buffer start"); hptr--; DPUTS(*hptr != (char) c, "BUG: wrong character in hungetc() "); -- cgit v1.2.3