about summary refs log tree commit diff
diff options
context:
space:
mode:
-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)) {