summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-08-13 01:32:31 +0200
committerOliver Kiddle <opk@zsh.org>2016-08-13 01:32:31 +0200
commitf760bd6064d429a851ec5a57a2c1b7896a1c0e51 (patch)
tree14d63c2b49564aaac7290e218ec97f0de77305a0 /Src
parenta1a58dde6adaa50625016f4c7048b456b2b99a1c (diff)
downloadzsh-f760bd6064d429a851ec5a57a2c1b7896a1c0e51.tar.gz
zsh-f760bd6064d429a851ec5a57a2c1b7896a1c0e51.tar.xz
zsh-f760bd6064d429a851ec5a57a2c1b7896a1c0e51.zip
39026: pattern specified with _arguments' -A option shouldn't be checked against words after the cursor
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/computil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 0028ac1ca..ecfa2bc34 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2167,9 +2167,11 @@ ca_parse_line(Cadef d, int multi, int first)
 #endif
 		   )
 	    return 1;
-	else if (state.arg && (!napat || !pattry(napat, line))) {
+	else if (state.arg &&
+		 (!napat || cur <= compcurrent || !pattry(napat, line))) {
 	    /* Otherwise it's a normal argument. */
-	    if (napat && ca_inactive(d, NULL, cur + 1, 1, NULL))
+	    if (napat && cur <= compcurrent &&
+		    ca_inactive(d, NULL, cur + 1, 1, NULL))
 		return 1;
 
 	    arglast = 1;