about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-19 11:43:12 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-19 11:43:12 +0000
commit11ec14c3b3942cf2c790bf077e704f745b754db9 (patch)
tree46be924034566539bcce8d54d5d3f6d20be7bee5
parent083befef2bfe9a93dbf6a6acfe2faed7f743d6ed (diff)
downloadzsh-11ec14c3b3942cf2c790bf077e704f745b754db9.tar.gz
zsh-11ec14c3b3942cf2c790bf077e704f745b754db9.tar.xz
zsh-11ec14c3b3942cf2c790bf077e704f745b754db9.zip
more careful when optimising patterns in compfiles (11981)
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/computil.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6117cdf86..6eeef80e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-06-19  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 11981: Src/Zle/computil.c: more careful when optimising patterns
+ 	in compfiles
+	
 	* 11977: Completion/Core/_options, Completion/Core/_set_options,
  	Completion/Core/_unset_options, Doc/Zsh/compwid.yo,
  	Src/Zle/comp.h, Src/Zle/complete.c, Src/Zle/compmatch.c,
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 3955ed69d..d65eaa5bf 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -3159,7 +3159,7 @@ cfp_matcher_pats(char *matcher, char *add)
 		if (m->wlen < 0 && !m->llen && m->ralen == 1) {
 		    for (tmp = add, tl = al, mp = ms; tl; tl--, tmp++, mp++) {
 			if (pattern_match(m->right, tmp, NULL, NULL)) {
-			    if (*mp) {
+			    if (*mp || (tmp == add && *tmp == '.')) {
 				*tmp = '\0';
 				al = tmp - add;
 				break;
@@ -3190,7 +3190,7 @@ cfp_matcher_pats(char *matcher, char *add)
 		    }
 	}
 	if (*add) {
-	    char *ret = "", buf[259];
+	    char *ret = "", buf[259], *oadd = add;
 
 	    for (mp = ms; *add; add++, mp++) {
 		if (!(m = *mp)) {