summary refs log tree commit diff
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2015-10-25 23:42:03 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2015-10-25 23:42:03 +0900
commita40417929cb6f94ccd8fb5af78aa47ff69a785c0 (patch)
tree081b234df975b0bf5ef6566a3fbf377fa1a50564
parent2685bbc4ae51516738c85da7ff1300262785f9b0 (diff)
downloadzsh-a40417929cb6f94ccd8fb5af78aa47ff69a785c0.tar.gz
zsh-a40417929cb6f94ccd8fb5af78aa47ff69a785c0.tar.xz
zsh-a40417929cb6f94ccd8fb5af78aa47ff69a785c0.zip
36911: '-optarg' should not match optspec '-opt='
Remove the requirement that -xy= should come before -x= in the
list of optspecs passed to _arguments.
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/computil.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e6edaa8c0..8bf01dc3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-25  Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+
+	* 36911: Src/Zle/computil.c: '-optarg' should not match
+	optspec '-opt='
+
 2015-10-24  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 36943 (with updated comment): Src/mem.c: restore scan for
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index e5db0867b..db8db88a6 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1693,10 +1693,13 @@ ca_get_opt(Cadef d, char *line, int full, char **end)
 	for (p = d->opts; p; p = p->next)
 	    if (p->active && ((!p->args || p->type == CAO_NEXT) ?
 			      !strcmp(p->name, line) : strpfx(p->name, line))) {
+	    int l = strlen(p->name);
+	    if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
+		line[l] && line[l] != '=')
+		continue;
+
 		if (end) {
 		    /* Return a pointer to the end of the option. */
-		    int l = strlen(p->name);
-
 		    if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
 			line[l] == '=')
 			l++;