diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-03 15:27:14 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-03 15:27:14 +0000 |
commit | b687bd97509053f27a27dab2f0e0cc13fa99ba02 (patch) | |
tree | 2a8597be0b5aae25bd6435ff023904ee9e107361 /Src | |
parent | 8a540b99c5098166e428195cf1426a995faa5e5c (diff) | |
download | zsh-b687bd97509053f27a27dab2f0e0cc13fa99ba02.tar.gz zsh-b687bd97509053f27a27dab2f0e0cc13fa99ba02.tar.xz zsh-b687bd97509053f27a27dab2f0e0cc13fa99ba02.zip |
Various completion fixes
Diffstat (limited to 'Src')
-rw-r--r-- | Src/Zle/computil.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index a844ee1ef..828fe36d0 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -2405,7 +2405,7 @@ bin_comptry(char *nam, char **args, char *ops, int func) while (*s) { while (*s && iblank(*s)) s++; - for (p = q = s, c = NULL; *s && !iblank(*s); s++) { + for (p = q = s, c = NULL; *s && !inblank(*s); s++) { if (!c && *s == ':') c = p; if (*s == '\\' && s[1]) @@ -2423,12 +2423,26 @@ bin_comptry(char *nam, char **args, char *ops, int func) tokenize(qq); if (haswilds(qq)) { Patprog prog; + LinkNode node; if ((prog = patcompile(qq, PAT_STATIC, NULL))) { char **a, *n; int l = (c ? strlen(c + 1) + 2 : 1), al; for (a = all; *a; a++) { + for (node = firstnode(list); node; + incnode(node)) { + char *as, *ls; + + for (as = *a, ls = (char *) getdata(node); + *as && *ls && *ls != ':'; as++, ls++) + if (*as != *ls) + break; + if (!*as && (!*ls || *ls == ':')) + break; + } + if (node) + continue; if (pattry(prog, *a)) { n = (char *) zhalloc((al = strlen(*a)) + l); strcpy(n, *a); |