summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-03-03 11:57:56 +0100
committerOliver Kiddle <opk@zsh.org>2014-03-03 11:57:56 +0100
commitb5fcc04f0e29ff00cb72b0e5c0bc9976c1c5eb33 (patch)
tree482819284eed7f40356ef9e2b1113afb13d69dc2 /Src
parent965d7305e57b9b1a009af71368fcbf6da4e756a8 (diff)
downloadzsh-b5fcc04f0e29ff00cb72b0e5c0bc9976c1c5eb33.tar.gz
zsh-b5fcc04f0e29ff00cb72b0e5c0bc9976c1c5eb33.tar.xz
zsh-b5fcc04f0e29ff00cb72b0e5c0bc9976c1c5eb33.zip
32436: allow = to be used in ZLS_COLORS patterns if it is quoted or inside parentheses
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/complist.c17
1 files changed, 15 insertions, 2 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';