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

Re: Non-escaped special chars from var expansion



On Fri, 2 Nov 2018 22:06:57 +0000
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > bindkey '\t' complete-word
> > mkdir 'foo; bar (baz)'
> > cd !:1
> > cd $PWD<tab>
> 
> (Whether the globbing should actually have worked is a question I
> haven't gone into.  But I suspect it's not a problem --- the _expand
> function is trying lots of things not all of which will work.)

In case anyone cares --- no, the glob shouldn't have worked here because
it looks like a bad set of glob qualifiers ("unknown file atribute b").

Next problem is whether it's trying too hard to get glob compilation on
something that's expanded from a variable, without GLOB_SUBST set.
Strictly, I think that probably *is* a problem.  In principle the
quoting should happen on the result of that expansion, and only
if was expanded (from a variable or command or whatever).  I don't think
I'm going down that route myself, however.

Fix so far committed --- I will leave it at that.

pws



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