From b687bd97509053f27a27dab2f0e0cc13fa99ba02 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 3 Apr 2000 15:27:14 +0000 Subject: Various completion fixes --- Src/Zle/computil.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Src') 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); -- cgit 1.4.1