Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: symlink chain.



On Fri, 02 Jan 2015 13:53:48 -0800
Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> Another little gotcha:
> 
>     $ whence -s /usr/bin/zsh
>     /usr/bin/zsh -> /usr/local/bin/zsh-5.0.7-165-g2194da1
> 
>     $ whence -sa /usr/bin/zsh
>     (nothing)
>
> 
> ... why would the '-a' switch kill the '-s' switch?

It's nothing to do with "-s", it's the "-a".  It searches the path for
all occurrences.  It still searches even if there's already a full
path.  This isn't a hell of a lot of use.

diff --git a/Src/builtin.c b/Src/builtin.c
index 47d1aa0..ebc0654 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3315,7 +3315,7 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 
 	/* Option -a is to search the entire path, *
 	 * rather than just looking for one match. */
-	if (all) {
+	if (all && **argv != '/') {
 	    char **pp, *buf;
 
 	    pushheap();

pws



Messages sorted by: Reverse Date, Date, Thread, Author