diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-10-13 08:44:57 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-10-13 08:44:57 +0000 |
commit | bb1fabf3ff99afa1536ac270f4940baf558a0698 (patch) | |
tree | 2d5e7746f167b1275f55305668c47369630ce3f7 | |
parent | f23b23e8a31f06fe738b6b2deef2bc33bbe45eac (diff) | |
download | zsh-bb1fabf3ff99afa1536ac270f4940baf558a0698.tar.gz zsh-bb1fabf3ff99afa1536ac270f4940baf558a0698.tar.xz zsh-bb1fabf3ff99afa1536ac270f4940baf558a0698.zip |
two completion matching fixes; wrong (path) prefix matching (removed path components) and reverse order of sub-strings in match-strings (12995)
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Src/Zle/compmatch.c | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index fc0cbeddd..f7693866d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-10-13 Sven Wischnowsky <wischnow@zsh.org> + + * 12995: Src/Zle/compmatch.c: two completion matching fixes; wrong + (path) prefix matching (removed path components) and reverse order + of sub-strings in match-strings + 2000-10-12 Sven Wischnowsky <wischnow@zsh.org> * 12974: Completion/Core/_tags, Completion/Core/_sort_tags, diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index c43140774..bdc9d99d6 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -498,7 +498,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, */ bslash = 0; - if (!sfx && lw && + if (!sfx && lw && (!part || test) && (l[ind] == w[ind] || (bslash = (lw > 1 && w[ind] == '\\' && (ind ? (w[0] == l[0]) : (w[1] == l[0])))))) { @@ -784,10 +784,10 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, /* Probably add the matched strings. */ if (!test) { if (sfx) - add_match_str(NULL, NULL, w, ow - w, 0); + add_match_str(NULL, NULL, w, ow - w, sfx); else - add_match_str(NULL, NULL, ow, w - ow, 0); - add_match_str(mp, tl, tw, mp->wlen, 0); + add_match_str(NULL, NULL, ow, w - ow, sfx); + add_match_str(mp, tl, tw, mp->wlen, sfx); if (sfx) add_match_sub(NULL, NULL, 0, w, ow - w); else @@ -846,7 +846,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, if (!lw) break; - if (exact) { + if (exact && !part) { /* If we just accepted some characters directly (at the * beginning of the loop) and now can't match any further, * we go back to before those characters and try again, |