From 8ffdf161c781b374dcaa461c1a5333f70cffdf6f Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Tue, 8 Oct 2013 07:21:29 -0700 Subject: 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. --- Src/hist.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Src') 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 != '%') { -- cgit 1.4.1