about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-10-11 15:16:17 +0100
committerPeter Stephenson <pws@zsh.org>2016-10-11 15:16:17 +0100
commit276197d1d1998fb62a20b63099f770c2beee5749 (patch)
tree812a3eb012e66637743549bcb1f5e6305bbe8c11 /Src/builtin.c
parent8f2ce89a0c80f6a0ecdc7c1189d6a94f620882f4 (diff)
downloadzsh-276197d1d1998fb62a20b63099f770c2beee5749.tar.gz
zsh-276197d1d1998fb62a20b63099f770c2beee5749.tar.xz
zsh-276197d1d1998fb62a20b63099f770c2beee5749.zip
36108: command -[vV] assumed -p
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c6
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);