about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index e1fd7a35b..943922725 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2491,7 +2491,7 @@ getquery(char *valid_chars, int purge)
 
 static int d;
 static char *guess, *best;
-static Patprog spckpat;
+static Patprog spckpat, spnamepat;
 
 /**/
 static void
@@ -2562,6 +2562,13 @@ spckword(char **s, int hist, int cmd, int ask)
     } else
 	spckpat = NULL;
 
+    if ((correct_ignore = getsparam("CORRECT_IGNORE_FILE")) != NULL) {
+	tokenize(correct_ignore = dupstring(correct_ignore));
+	remnulargs(correct_ignore);
+	spnamepat = patcompile(correct_ignore, 0, NULL);
+    } else
+	spnamepat = NULL;
+
     if (**s == String && !*t) {
 	guess = *s + 1;
 	if (itype_end(guess, IIDENT, 1) == guess)
@@ -3783,6 +3790,8 @@ mindist(char *dir, char *mindistguess, char *mindistbest)
     if (!(dd = opendir(unmeta(dir))))
 	return mindistd;
     while ((fn = zreaddir(dd, 0))) {
+	if (spnamepat && pattry(spnamepat, fn))
+	    continue;
 	nd = spdist(fn, mindistguess,
 		    (int)strlen(mindistguess) / 4 + 1);
 	if (nd <= mindistd) {