From 99f74d6c0ac76910e45435dc69a3441415721a01 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 29 Sep 2016 14:19:07 +0100 Subject: unposted: Update findcmd() in Zle. Unfinished business from previous patch. --- ChangeLog | 3 +++ Src/Zle/compctl.c | 7 ++++--- Src/Zle/zle_tricky.c | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 35dfae0d3..883ff0230 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-09-29 Peter Stephenson + * unposted: Src/Zle/compctl.c, Src/Zle/zle_tricky.c: update + findcmd() call here, too. + * 39493: Src/builtin.c, Src/exec.c, Src/subst.c, Test/A01grammar.ztst: make "command" with multiple options work better and ensure "command -p" with "-v" or "-V" checks for a diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c index c2da2977f..09e590569 100644 --- a/Src/Zle/compctl.c +++ b/Src/Zle/compctl.c @@ -1965,7 +1965,7 @@ addmatch(char *s, char *t) if (!ms) return; - if (addwhat == -7 && !findcmd(s, 0)) + if (addwhat == -7 && !findcmd(s, 0, 0)) return; isfile = CMF_FILE; } else if (addwhat == CC_QUOTEFLAG || addwhat == -2 || @@ -2469,7 +2469,7 @@ makecomplistcmd(char *os, int incmd, int flags) /* If the command string starts with `=', try the path name of the * * command. */ if (cmdstr && cmdstr[0] == Equals) { - char *c = findcmd(cmdstr + 1, 1); + char *c = findcmd(cmdstr + 1, 1, 0); if (c) { zsfree(cmdstr); @@ -2509,7 +2509,8 @@ makecomplistpc(char *os, int incmd) int ret = 0; s = ((shfunctab->getnode(shfunctab, cmdstr) || - builtintab->getnode(builtintab, cmdstr)) ? NULL : findcmd(cmdstr, 1)); + builtintab->getnode(builtintab, cmdstr)) ? NULL : + findcmd(cmdstr, 1, 0)); for (pc = patcomps; pc; pc = pc->next) { if ((pat = patcompile(pc->pat, PAT_STATIC, NULL)) && diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 958e79ffb..c8d3bb35b 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -709,7 +709,8 @@ docomplete(int lst) for (t0 = cmdnamtab->hsize - 1; t0 >= 0; t0--) for (hn = cmdnamtab->nodes[t0]; hn; hn = hn->next) { - if (strpfx(q, hn->nam) && findcmd(hn->nam, 0)) + if (strpfx(q, hn->nam) && + findcmd(hn->nam, 0, 0)) n++; if (n == 2) break; @@ -3027,7 +3028,7 @@ expandcmdpath(UNUSED(char **args)) return 1; } - str = findcmd(s, 1); + str = findcmd(s, 1, 0); zsfree(s); if (!str) return 1; -- cgit 1.4.1