summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-15 08:09:09 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-15 08:09:09 +0000
commitdc102b813026240217920f5a027f47d12241913b (patch)
tree83f243cb769e2882d02142c097afe015a3440b32
parenta777f021a2101c90335f6f88eb31895df0e6f0a6 (diff)
downloadzsh-dc102b813026240217920f5a027f47d12241913b.tar.gz
zsh-dc102b813026240217920f5a027f47d12241913b.tar.xz
zsh-dc102b813026240217920f5a027f47d12241913b.zip
fix for _arguments, it took non-option strings as options (11910)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/computil.c15
2 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d1e70ba3..6308f7fec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-15  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 11910: Src/Zle/computil.c: fix for _arguments, it took
+ 	non-option strings as options
+	
 2000-06-14  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
 
 	* 11906: Src/signals.c: yet another two bugs with saving traps:
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index b58729fc1..51a1f61aa 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1083,7 +1083,7 @@ ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp)
     LinkList l = NULL;
 
     *lp = NULL;
-    for (p = NULL; *line; line++)
+    for (p = NULL; *line; line++) {
 	if ((p = d->single[STOUC(*line)]) && p->active &&
 	    p->args && p->name[0] == pre) {
 	    if (p->type == CAO_NEXT) {
@@ -1100,8 +1100,10 @@ ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp)
 		}
 		break;
 	    }
-	} else if (!p || (!p->active && p->name[0] != pre))
+	} else if (p && !p->active)
 	    return NULL;
+	p = NULL;
+    }
     if (p && end)
 	*end = line;
     return p;
@@ -1444,7 +1446,14 @@ ca_parse_line(Cadef d, int multi, int first)
 		state.opt = 0;
 	    else
 		state.curopt = NULL;
-	} else if (multi && (*line == '-' || *line == '+') && cur != compcurrent)
+	} else if (multi && (*line == '-' || *line == '+') && cur != compcurrent
+#if 0
+		   /**** Ouch. Using this will disable the mutual exclusion
+			 of different sets. Not using it will make the -A
+			 pattern be effectively ignored with multiple sets. */
+		   && (!napat || !pattry(napat, line))
+#endif
+		   )
 	    return 1;
 	else if (state.arg && (!napat || !pattry(napat, line))) {
 	    /* Otherwise it's a normal argument. */