about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/complist.c17
-rw-r--r--Src/Zle/zle_hist.c4
-rw-r--r--Src/Zle/zle_params.c2
3 files changed, 20 insertions, 3 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index b852ee99f..5e5ba9f20 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -383,12 +383,25 @@ getcoldef(char *s)
     } else if (*s == '=') {
 	char *p = ++s, *t, *cols[MAX_POS];
 	int ncols = 0;
+	int nesting = 0;
 	Patprog prog;
 
 	/* This is for a pattern. */
 
-	while (*s && *s != '=')
-	    s++;
+	while (*s && (nesting || *s != '=')) {
+	    switch (*s++) {
+		case '\\':
+		    if (*s)
+			s++;
+		    break;
+		case '(':
+		    nesting++;
+		    break;
+		case ')':
+		    nesting--;
+		    break;
+	    }
+	}
 	if (!*s)
 	    return s;
 	*s++ = '\0';
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index bd5bc36d5..44b39d186 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -890,6 +890,10 @@ zgetline(UNUSED(char **args))
 	free(s);
 	free(lineadd);
 	clearlist = 1;
+	if (stackhist != -1) {
+	    histline = stackhist;
+	    stackhist = -1;
+	}
     }
     return 0;
 }
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index a9bbf136a..5845207fa 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -363,7 +363,7 @@ get_prebuffer(UNUSED(Param pm))
 static char *
 get_widget(UNUSED(Param pm))
 {
-    return bindk->nam;
+    return bindk ? bindk->nam : "";
 }
 
 /**/