From 07c8fbe59632be71e4ad5bfafbf6aa4884cd04c4 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 29 Sep 2016 11:00:44 +0100 Subject: 34943: Fixes for "command" with multiple options. These need to combine properly, and alos "command -p" with either -v or -V needs to search for builtins and then using the default system path. --- Src/builtin.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index 248f929d7..c78fd9b3a 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3643,7 +3643,15 @@ bin_whence(char *nam, char **argv, Options ops, int func) returnval = 1; } popheap(); - } else if ((cnam = findcmd(*argv, 1))) { + } else if (func == BIN_COMMAND && + (hn = builtintab->getnode(builtintab, *argv))) { + /* + * Special case for "command -p[vV]" which needs to + * show a builtin in preference to an external command. + */ + builtintab->printnode(hn, printflags); + informed = 1; + } else if ((cnam = findcmd(*argv, 1, func == BIN_COMMAND))) { /* Found external command. */ if (wd) { printf("%s: command\n", *argv); -- cgit 1.4.1