about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c6
1 files changed, 5 insertions, 1 deletions
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;
 }