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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index cf375821d..d259827a9 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2236,6 +2236,7 @@ getquery(char *valid_chars, int purge)
 
 static int d;
 static char *guess, *best;
+static Patprog spckpat;
 
 /**/
 static void
@@ -2243,6 +2244,9 @@ spscan(HashNode hn, UNUSED(int scanflags))
 {
     int nd;
 
+    if (spckpat && pattry(spckpat, hn->nam))
+	return;
+
     nd = spdist(hn->nam, guess, (int) strlen(guess) / 4 + 1);
     if (nd <= d) {
 	best = hn->nam;
@@ -2257,7 +2261,7 @@ spscan(HashNode hn, UNUSED(int scanflags))
 mod_export void
 spckword(char **s, int hist, int cmd, int ask)
 {
-    char *t;
+    char *t, *correct_ignore;
     int x;
     char ic = '\0';
     int ne;
@@ -2293,6 +2297,14 @@ spckword(char **s, int hist, int cmd, int ask)
 	    break;
     if (**s == Tilde && !*t)
 	return;
+
+    if ((correct_ignore = getsparam("CORRECT_IGNORE")) != NULL) {
+	tokenize(correct_ignore = dupstring(correct_ignore));
+	remnulargs(correct_ignore);
+	spckpat = patcompile(correct_ignore, 0, NULL);
+    } else
+	spckpat = NULL;
+
     if (**s == String && !*t) {
 	guess = *s + 1;
 	if (itype_end(guess, IIDENT, 1) == guess)