summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2015-07-06 22:40:47 +0200
committerOliver Kiddle <opk@zsh.org>2015-07-06 22:40:47 +0200
commit68a5a5f453d9534748e12d268718a97b7e84c31b (patch)
tree887b02090e498e6097368273ae61723ee790e7e3
parent0b946c18eac9b1be3424ecaa037a837af59a920c (diff)
downloadzsh-68a5a5f453d9534748e12d268718a97b7e84c31b.tar.gz
zsh-68a5a5f453d9534748e12d268718a97b7e84c31b.zip
35704: compadd -E 0 should imply -J and -2
-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]) {