From b3a88a53d379d6b59ccee468723a034f65fd757d Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 19 Nov 2016 07:55:42 +0000 Subject: 39982: $SPROMPT: Don't accept a spelling correction at space/tab. The patch also downscopes a couple of local variables, with no functional change. --- Src/utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Src') diff --git a/Src/utils.c b/Src/utils.c index 7bbd5887f..7f3ddad40 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -2944,9 +2944,7 @@ mod_export void spckword(char **s, int hist, int cmd, int ask) { char *t, *correct_ignore; - int x; char ic = '\0'; - int ne; int preflen = 0; int autocd = cmd && isset(AUTOCD) && strcmp(*s, ".") && strcmp(*s, ".."); @@ -3015,6 +3013,7 @@ spckword(char **s, int hist, int cmd, int ask) } else { guess = *s; if (*guess == Tilde || *guess == String) { + int ne; ic = *guess; if (!*++t) return; @@ -3059,6 +3058,7 @@ spckword(char **s, int hist, int cmd, int ask) if (errflag) return; if (best && (int)strlen(best) > 1 && strcmp(best, guess)) { + int x; if (ic) { char *u; if (preflen) { @@ -3088,14 +3088,14 @@ spckword(char **s, int hist, int cmd, int ask) free(pptbuf); fflush(shout); zbeep(); - x = getquery("nyae \t", 0); + x = getquery("nyae", 0); if (cmd && x == 'n') pathchecked = path; } else x = 'n'; } else x = 'y'; - if (x == 'y' || x == ' ' || x == '\t') { + if (x == 'y') { *s = dupstring(best); if (hist) hwrep(best); -- cgit 1.4.1