diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-11-19 07:55:42 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-11-24 08:18:28 +0000 |
commit | b3a88a53d379d6b59ccee468723a034f65fd757d (patch) | |
tree | ed71d19a6beb3575fd01f4987f0b4fb112c85076 /Src | |
parent | c0f95d07e7be34a30047a8202aeb01b864600151 (diff) | |
download | zsh-b3a88a53d379d6b59ccee468723a034f65fd757d.tar.gz zsh-b3a88a53d379d6b59ccee468723a034f65fd757d.tar.xz zsh-b3a88a53d379d6b59ccee468723a034f65fd757d.zip |
39982: $SPROMPT: Don't accept a spelling correction at space/tab.
The patch also downscopes a couple of local variables, with no functional change.
Diffstat (limited to 'Src')
-rw-r--r-- | Src/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |