summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_tricky.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a06dbc68..b1121ffe4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-06-23  Bart Schaefer  <schaefer@zsh.org>
 
+	* 15056: Src/Zle/zle_tricky.c: Change magic-space to recognize
+	whether !" (quote against history expansion) has been typed.
+
 	* 15050, 15054: Src/exec.c: Change exit status of external
 	commands that could not be executed, to comply with POSIX.
 
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 5886b4114..542b50381 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2241,9 +2241,13 @@ doexpandhist(void)
 int
 magicspace(char **args)
 {
+    char *bangq;
     int ret;
     c = ' ';
-    if (!(ret = selfinsert(args)))
+    for (bangq = (char *)line; (bangq = strchr(bangq, bangchar)); bangq += 2)
+	if (bangq[1] == '"' && (bangq == (char *)line || bangq[-1] != '\\'))
+	    break;
+    if (!(ret = selfinsert(args)) && (!bangq || bangq + 2 > (char *)line + cs))
 	doexpandhist();
     return ret;
 }