about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--Src/hist.c6
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  <p.stephenson@samsung.com>
+
+	* 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  <d.s@daniel.shahaf.name>
 
 	* 34739: Completion/Unix/Command/_git: git completion: Fix
@@ -12,7 +18,7 @@
 
 2015-03-18  Peter Stephenson  <p.stephenson@samsung.com>
 
-	* 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  <p.stephenson@samsung.com>
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() ");