about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2011-11-15 15:08:56 +0000
committerBart Schaefer <barts@users.sourceforge.net>2011-11-15 15:08:56 +0000
commit7c5173ba0fd41027ec32d4f7cf29deaaadbec1e4 (patch)
tree5f23ae03964c8a097739228a728711003f18cf01
parentc6722cf086b09ed63d1441986d0c7774a9280861 (diff)
downloadzsh-7c5173ba0fd41027ec32d4f7cf29deaaadbec1e4.tar.gz
zsh-7c5173ba0fd41027ec32d4f7cf29deaaadbec1e4.tar.xz
zsh-7c5173ba0fd41027ec32d4f7cf29deaaadbec1e4.zip
users/16581: skip correction shortcut based on command table search when
the word is not in command position; on rejected command correction,
reset incremental path hashing.
-rw-r--r--ChangeLog11
-rw-r--r--Src/utils.c22
2 files changed, 22 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 0182247df..71376d100 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-15  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* users/16581: Src/utils.c: it seems wrong to shortcut correction
+	of words not in command position by comparing them to the command
+	tables, so don't; if a command correction is rejected, reset the
+	incremental path hashing so the new command can be "learned".
+
 2011-11-14  Peter Stephenson  <pws@csr.com>
 
 	* gi1242: users/16578: Completion/Unix/Command/_lp: lpadmin,
@@ -117,7 +124,7 @@
 
 	* 29815: Doc/Makefile.in: include mod_langinfo in documentation.
 
-2011-09-25  Barton E. Schaefer  <schaefer@brasslantern.com>
+2011-09-25  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 29799: Src/utils.c: swap order of RESET_PROMPT / REFRESH in
 	adjustwinsize() so that the cursor is moved to the start of a
@@ -15570,5 +15577,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5498 $
+* $Revision: 1.5499 $
 *****************************************************
diff --git a/Src/utils.c b/Src/utils.c
index 41bf0b149..6c2ea98d5 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2498,16 +2498,18 @@ spckword(char **s, int hist, int cmd, int ask)
 	return;
     if (!(*s)[0] || !(*s)[1])
 	return;
-    if (shfunctab->getnode(shfunctab, *s) ||
-	builtintab->getnode(builtintab, *s) ||
-	cmdnamtab->getnode(cmdnamtab, *s) ||
-	aliastab->getnode(aliastab, *s)  ||
-	reswdtab->getnode(reswdtab, *s))
-	return;
-    else if (isset(HASHLISTALL)) {
-	cmdnamtab->filltable(cmdnamtab);
-	if (cmdnamtab->getnode(cmdnamtab, *s))
+    if (cmd) {
+	if (shfunctab->getnode(shfunctab, *s) ||
+	    builtintab->getnode(builtintab, *s) ||
+	    cmdnamtab->getnode(cmdnamtab, *s) ||
+	    aliastab->getnode(aliastab, *s)  ||
+	    reswdtab->getnode(reswdtab, *s))
 	    return;
+	else if (isset(HASHLISTALL)) {
+	    cmdnamtab->filltable(cmdnamtab);
+	    if (cmdnamtab->getnode(cmdnamtab, *s))
+		return;
+	}
     }
     t = *s;
     if (*t == Tilde || *t == Equals || *t == String)
@@ -2621,6 +2623,8 @@ spckword(char **s, int hist, int cmd, int ask)
 		fflush(shout);
 		zbeep();
 		x = getquery("nyae \t", 0);
+		if (cmd && x == 'n')
+		    pathchecked = path;
 	    } else
 		x = 'n';
 	} else