summary refs log tree commit diff
diff options
context:
space:
mode:
-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);