about summary refs log tree commit diff
path: root/Src/hist.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2013-10-08 07:21:29 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2013-10-08 07:21:29 -0700
commit8ffdf161c781b374dcaa461c1a5333f70cffdf6f (patch)
tree8576344010ae9a60f225954676724fc8dde6fe90 /Src/hist.c
parent6f195241f3ee98c11bc93ab089417012767d9cec (diff)
downloadzsh-8ffdf161c781b374dcaa461c1a5333f70cffdf6f.tar.gz
zsh-8ffdf161c781b374dcaa461c1a5333f70cffdf6f.tar.xz
zsh-8ffdf161c781b374dcaa461c1a5333f70cffdf6f.zip
31797: to match documentation, avoid expanding history when there is neither a
word nor an event designator

There are still a few cases where expansion is attempted even though the
documentation indicates it will not be, but in most of those cases the
expansion will fail.  The now-fixed case would fall back to default
expansion of the previous command.
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Src/hist.c b/Src/hist.c
index d1af30a29..bd650e81e 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -521,6 +521,12 @@ histsubchar(int c)
 		}
 		c = ingetc();
 	    }
+	    if (ptr == buf &&
+		(c == '}' ||  c == ';' || c == '\'' || c == '"' || c == '`')) {
+	      /* Neither event nor word designator, no expansion */
+	      safeinungetc(c);
+	      return bangchar;
+	    }
 	    *ptr = 0;
 	    if (!*buf) {
 		if (c != '%') {