about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-03-19 11:10:49 +0000
committerPeter Stephenson <pws@zsh.org>2015-03-19 11:10:49 +0000
commitf48457a695eef49fc3fb5571f73cc045bc7323cf (patch)
treeb9f999e01268736bfdffd83fd101df5afcf24c01 /Src
parente176eff554b592cd649a88cd7de23399755e43f4 (diff)
downloadzsh-f48457a695eef49fc3fb5571f73cc045bc7323cf.tar.gz
zsh-f48457a695eef49fc3fb5571f73cc045bc7323cf.tar.xz
zsh-f48457a695eef49fc3fb5571f73cc045bc7323cf.zip
34742: history expansion inside command substitution failed.
Needs the case of alias expansion separating out.
Diffstat (limited to 'Src')
-rw-r--r--Src/hist.c6
1 files changed, 4 insertions, 2 deletions
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() ");