summaryrefslogtreecommitdiff
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
parent8f2ce89a0c80f6a0ecdc7c1189d6a94f620882f4 (diff)
downloadzsh-276197d1d1998fb62a20b63099f770c2beee5749.tar.gz
zsh-276197d1d1998fb62a20b63099f770c2beee5749.zip
36108: command -[vV] assumed -p
-rw-r--r--ChangeLog4
-rw-r--r--Src/builtin.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f41c18fe..4ce4ec2e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-11 Peter Stephenson <p.stephenson@samsung.com>
+
+ * 36108: Src/builtin.c: command -[vV] assumed -p.
+
2016-10-10 Peter Stephenson <p.stephenson@samsung.com>
* 39599: Src/loop.c, Test/A01grammar.ztst: Don't reset status
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);