summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-01-24 11:12:41 +0000
committerPeter Stephenson <pws@zsh.org>2017-01-24 11:12:41 +0000
commit3e5badb0c909d2b192552c2385dd1188e6efd36e (patch)
tree29f9ad615e7fe55854c2d4908927363af31d344f /Src
parentc861b17bbf002129f29e22ab625fd3516ba792a2 (diff)
downloadzsh-3e5badb0c909d2b192552c2385dd1188e6efd36e.tar.gz
zsh-3e5badb0c909d2b192552c2385dd1188e6efd36e.tar.xz
zsh-3e5badb0c909d2b192552c2385dd1188e6efd36e.zip
40404: Only quote command in whence output with -v.
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 2fb1a70a4..219fbc98f 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3774,9 +3774,11 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 		    if (wd) {
 			printf("%s: command\n", *argv);
 		    } else {
-			if (v && !csh)
+			if (v && !csh) {
 			    zputs(*argv, stdout), fputs(" is ", stdout);
-			quotedzputs(buf, stdout);
+			    quotedzputs(buf, stdout);
+			} else
+			    zputs(buf, stdout);
 			if (OPT_ISSET(ops,'s') || OPT_ISSET(ops, 'S'))
 			    print_if_link(buf, OPT_ISSET(ops, 'S'));
 			fputc('\n', stdout);
@@ -3806,9 +3808,11 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 	    if (wd) {
 		printf("%s: command\n", *argv);
 	    } else {
-		if (v && !csh)
+		if (v && !csh) {
 		    zputs(*argv, stdout), fputs(" is ", stdout);
-		quotedzputs(cnam, stdout);
+		    quotedzputs(cnam, stdout);
+		} else
+		    zputs(cnam, stdout);
 		if (OPT_ISSET(ops,'s') || OPT_ISSET(ops,'S'))
 		    print_if_link(cnam, OPT_ISSET(ops,'S'));
 		fputc('\n', stdout);