about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-10-09 12:50:20 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-10-09 12:50:20 +0000
commit3f63f136103e15c1a6f50605087d692fa30d77eb (patch)
tree2100456aaa1a0479cc576aa69a56c7a18f638b47
parentbb18608a2a3eafa09b007f47820303ac8b9e417b (diff)
downloadzsh-3f63f136103e15c1a6f50605087d692fa30d77eb.tar.gz
zsh-3f63f136103e15c1a6f50605087d692fa30d77eb.tar.xz
zsh-3f63f136103e15c1a6f50605087d692fa30d77eb.zip
prefer exact character matches over match specs (so that `nom' can match `nomatch') (12930)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/compmatch.c11
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8eb18827a..9cb3fdeae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-10-09  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 12930: Src/Zle/compmatch.c: prefer exact character matches over
+ 	match specs (so that `nom' can match `nomatch')
+	
 2000-10-06  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 12919: Completion/User/_tiff, Completion/X/_xv: search for *.tif
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index 3cb0ea12f..6bf82c18e 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -485,10 +485,19 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 	 * recursive calls. At least, it /seems/ to work.
 	 *
 	 * Let's try.
+	 *
+	 * Update: this once tested `test && ...' to check for exact
+	 * character matches only in recursive calls.  But then one
+	 * can't complete `nom<TAB>' to `nomatch' with a match spec
+	 * of `B:[nN][oO]=' because that will eat the `no'. I'm almost
+	 * certain that this will break something, but I don't know what
+	 * or if it really is a problem (or has been fixed by other
+	 * changes in the code handling partial word matching). And the
+	 * completion matching tests work.
 	 */
 
 	bslash = 0;
-	if (test && !sfx && lw &&
+	if (!sfx && lw &&
 	    (l[ind] == w[ind] ||
 	     (bslash = (lw > 1 && w[ind] == '\\' &&
 			(ind ? (w[0] == l[0]) : (w[1] == l[0])))))) {