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. --- ChangeLog | 8 +++++++- Src/hist.c | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 319cbb102..91709629a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-03-19 Peter Stephenson + + * 34742: Src/hist.c: history expansion in command substitution + didn't work. Discriminate the case of an alias expansion + more carefully. + 2015-03-19 Daniel Shahaf * 34739: Completion/Unix/Command/_git: git completion: Fix @@ -12,7 +18,7 @@ 2015-03-18 Peter Stephenson - * 34723: configure.ac: turn off fixed site function directory if + * 34732: configure.ac: turn off fixed site function directory if site function directory explicitly disabled. 2015-03-17 Peter Stephenson 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 1.4.1