From 25ca4f8792b99cc127f04ad059e0c66cb6e0face Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Wed, 7 Jun 2000 11:21:42 +0000 Subject: optimise command lookup in old and new completion (user/3124) --- Src/Zle/compctl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c index 0e1dc088c..c7356b69f 100644 --- a/Src/Zle/compctl.c +++ b/Src/Zle/compctl.c @@ -2469,7 +2469,7 @@ makecomplistcmd(char *os, int incmd, int flags) return ret; } -/* This add the matches for the pattern compctls. */ +/* This adds the matches for the pattern compctls. */ /**/ static int @@ -2477,9 +2477,12 @@ makecomplistpc(char *os, int incmd) { Patcomp pc; Patprog pat; - char *s = findcmd(cmdstr, 1); + char *s; int ret = 0; + s = ((shfunctab->getnode(shfunctab, cmdstr) || + builtintab->getnode(builtintab, cmdstr)) ? NULL : findcmd(cmdstr, 1)); + for (pc = patcomps; pc; pc = pc->next) { if ((pat = patcompile(pc->pat, PAT_STATIC, NULL)) && (pattry(pat, cmdstr) || -- cgit 1.4.1