about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/computil.c2
-rw-r--r--Test/Y03arguments.ztst6
3 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d11b6ebd6..371f08ca8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-09-28  Oliver Kiddle  <opk@zsh.org>
 
+	* 41772: Src/Zle/computil.c, Test/Y03arguments.ztst: fix bug
+	in handling of long options with _arguments' -A option
+
 	* 41762: Completion/Zsh/Context/_value: fix for completion
 	in assignment to associative array element
 
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index e704f9ffa..0368a07d0 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1824,7 +1824,7 @@ ca_inactive(Cadef d, char **xor, int cur, int opts)
 	char *x;
         /* current word could be a prefix of a longer one so only do
 	 * exclusions for single-letter options (for option clumping) */
-	int single = (cur == compcurrent);
+	int single = !opts && (cur == compcurrent);
 
 	for (; (x = (opts ? "-" : *xor)); xor++) {
 	    int excludeall = 0;
diff --git a/Test/Y03arguments.ztst b/Test/Y03arguments.ztst
index 25bb96b84..94ce8361e 100644
--- a/Test/Y03arguments.ztst
+++ b/Test/Y03arguments.ztst
@@ -333,6 +333,12 @@
 0:option after a word
 >line: {tst word -x }{}
 
+ tst_arguments -A '-*' -x --extra ::first
+ comptest $'tst word -\t'
+0:long option after word that doesn't match -A pattern
+>line: {tst word -}{}
+>MESSAGE:{no more arguments}
+
  tst_arguments -A'-*' -x :word
  comptest $'tst word -\t'
 0:option after word that doesn't match -A pattern, no space before pattern