1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 21:44:11 +01:00

prefer exact character matches over match specs (so that nom' can match nomatch') (12930)

This commit is contained in:
Sven Wischnowsky 2000-10-09 12:50:20 +00:00
parent bb18608a2a
commit 3f63f13610
2 changed files with 15 additions and 1 deletions

@ -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> 2000-10-06 Sven Wischnowsky <wischnow@zsh.org>
* 12919: Completion/User/_tiff, Completion/X/_xv: search for *.tif * 12919: Completion/User/_tiff, Completion/X/_xv: search for *.tif

@ -485,10 +485,19 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
* recursive calls. At least, it /seems/ to work. * recursive calls. At least, it /seems/ to work.
* *
* Let's try. * 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; bslash = 0;
if (test && !sfx && lw && if (!sfx && lw &&
(l[ind] == w[ind] || (l[ind] == w[ind] ||
(bslash = (lw > 1 && w[ind] == '\\' && (bslash = (lw > 1 && w[ind] == '\\' &&
(ind ? (w[0] == l[0]) : (w[1] == l[0])))))) { (ind ? (w[0] == l[0]) : (w[1] == l[0])))))) {