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

Re: PATH: autoload with explicit path



On Mon, 16 Jan 2017 07:22:23 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> On Mon, Jan 16, 2017 at 2:37 AM, Peter Stephenson
> <p.stephenson@xxxxxxxxxxx> wrote:
> >
> > % whence -v my\ stupid\ function\ name
> > my stupid function name is a shell function from /export/home/pws/src/zsh-git/code/'my stupid function name'
> >
> > You might even consider that a feature.
> 
> When was this pushed?  I don't get any quoting.
> 
> % path+=(/tmp/one\ space)
> % whence -v two\ space
> two space is /tmp/one space/two space

That's not a shell function, that's a command.  Looks like that doesn't
do quoting.; I presume that's just a historical oversight.

This would handle the other verbose "is" cases.  However, in this case
the entire path is passed back by findcmd, so it's all quoted.  Updating
findcmd() would make it more efficient (don't need to copy the
directory) and more consistent with the function case, but it's too
minor for me to feel like doing.

pws

diff --git a/Src/builtin.c b/Src/builtin.c
index a683032..b1b6e2e 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3747,7 +3747,7 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 		    } else {
 			if (v && !csh)
 			    zputs(*argv, stdout), fputs(" is ", stdout);
-			zputs(buf, stdout);
+			quotedzputs(buf, stdout);
 			if (OPT_ISSET(ops,'s') || OPT_ISSET(ops, 'S'))
 			    print_if_link(buf, OPT_ISSET(ops, 'S'));
 			fputc('\n', stdout);
@@ -3779,7 +3779,7 @@ bin_whence(char *nam, char **argv, Options ops, int func)
 	    } else {
 		if (v && !csh)
 		    zputs(*argv, stdout), fputs(" is ", stdout);
-		zputs(cnam, stdout);
+		quotedzputs(cnam, stdout);
 		if (OPT_ISSET(ops,'s') || OPT_ISSET(ops,'S'))
 		    print_if_link(cnam, OPT_ISSET(ops,'S'));
 		fputc('\n', stdout);



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