diff options
Diffstat (limited to 'Src/builtin.c')
-rw-r--r-- | Src/builtin.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index a274ff791..8b8b217d8 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3663,7 +3663,7 @@ bin_whence(char *nam, char **argv, Options ops, int func) returnval = 1; } popheap(); - } else if (func == BIN_COMMAND && + } else if (func == BIN_COMMAND && OPT_ISSET(ops,'p') && (hn = builtintab->getnode(builtintab, *argv))) { /* * Special case for "command -p[vV]" which needs to @@ -3671,7 +3671,9 @@ bin_whence(char *nam, char **argv, Options ops, int func) */ builtintab->printnode(hn, printflags); informed = 1; - } else if ((cnam = findcmd(*argv, 1, func == BIN_COMMAND))) { + } else if ((cnam = findcmd(*argv, 1, + func == BIN_COMMAND && + OPT_ISSET(ops,'p')))) { /* Found external command. */ if (wd) { printf("%s: command\n", *argv); |