summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-06-29 17:04:50 +0200
committerOliver Kiddle <opk@zsh.org>2016-06-29 17:04:50 +0200
commit5ea32ce2fcd527e9b6e6991c007d296afc5aa44d (patch)
tree6f742e4f3a40cadc9a9a7bdc5b611e6c6510eba1
parent3a034838b4a76924a7fff98c269c9c3ea3136d45 (diff)
downloadzsh-5ea32ce2fcd527e9b6e6991c007d296afc5aa44d.tar.gz
zsh-5ea32ce2fcd527e9b6e6991c007d296afc5aa44d.tar.xz
zsh-5ea32ce2fcd527e9b6e6991c007d296afc5aa44d.zip
38752: add comments to explain use of stdout instead of stderr for the which builtin
-rw-r--r--ChangeLog5
-rw-r--r--Src/builtin.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 503b905f8..4f0a49397 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-29  Oliver Kiddle  <opk@zsh.org>
+
+	* 38752: Src/builtin.c: add comments to explain use of stdout
+	instead of stderr for the which builtin
+
 2016-06-27  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 38760: Completion/Unix/Command/_git: _git-config: Stop trying
diff --git a/Src/builtin.c b/Src/builtin.c
index c2fb81ed1..bfb9e6929 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3633,6 +3633,7 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 		}
 	    }
 	    if (!informed && (wd || v || csh)) {
+		/* this is information and not an error so, as in csh, use stdout */
 		zputs(*argv, stdout);
 		puts(wd ? ": none" : " not found");
 		returnval = 1;
@@ -3652,7 +3653,7 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 	    }
 	    informed = 1;
 	} else {
-	    /* Not found at all. */
+	    /* Not found at all. That's not an error as such so this goes to stdout */
 	    if (v || csh || wd)
 		zputs(*argv, stdout), puts(wd ? ": none" : " not found");
 	    returnval = 1;