summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/compwid.yo4
-rw-r--r--Src/Zle/compcore.c4
-rw-r--r--Src/Zle/complete.c2
4 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 947d8b333..a7eb45224 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-06  Oliver Kiddle  <opk@zsh.org>
+
+	* 35704: Doc/Zsh/compwid.yo, Src/Zle/compcore.c, Src/Zle/complete.c;
+	compadd -E 0 should imply -J and -2
+
 2015-07-06  Mikael Magnusson  <mikachu@gmail.com>
 
 	* 35696: Completion/Unix/Type/_ps1234: complete colors for %F{
diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo
index 0c0a15d41..40cabea88 100644
--- a/Doc/Zsh/compwid.yo
+++ b/Doc/Zsh/compwid.yo
@@ -697,7 +697,9 @@ format completion lists and to make explanatory string be shown in
 completion lists (since empty matches can be given display strings
 with the tt(-d) option).  And because all but one empty string would
 otherwise be removed, this option implies the tt(-V) and tt(-2)
-options (even if an explicit tt(-J) option is given).
+options (even if an explicit tt(-J) option is given).  This can be
+important to note as it affects the name space into which matches are
+added.
 )
 xitem(tt(-))
 item(tt(-)tt(-))(
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index ba538ca99..ae3a64074 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -2049,7 +2049,7 @@ addmatches(Cadata dat, char **argv)
     Heap oldheap;
 
     SWITCHHEAPS(oldheap, compheap) {
-        if (dat->dummies)
+        if (dat->dummies >= 0)
             dat->aflags = ((dat->aflags | CAF_NOSORT | CAF_UNIQCON) &
                            ~CAF_UNIQALL);
 
@@ -2534,7 +2534,7 @@ addmatches(Cadata dat, char **argv)
             addmatch("<all>", dat->flags | CMF_ALL, &disp, 1);
 	    hasallmatch = 1;
 	}
-        while (dat->dummies--)
+        while (dat->dummies-- > 0)
             addmatch("", dat->flags | CMF_DUMMY, &disp, 0);
 
     } SWITCHBACKHEAPS(oldheap);
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 471c9f491..30173927d 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -540,7 +540,7 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
     dat.match = NULL;
     dat.flags = 0;
     dat.aflags = CAF_MATCH;
-    dat.dummies = 0;
+    dat.dummies = -1;
 
     for (; *argv && **argv ==  '-'; argv++) {
 	if (!(*argv)[1]) {