zsh-workers
 help / color / mirror / code / Atom feed
* cd completion does not work in CVS version (unsafe word splitting in _alternative).
@ 1999-12-23 14:58 Andrej Borsenkow
  1999-12-23 15:57 ` Andrej Borsenkow
  0 siblings, 1 reply; 2+ messages in thread
From: Andrej Borsenkow @ 1999-12-23 14:58 UTC (permalink / raw)
  To: ZSH workers mailing list

With fresh CVS ... (actually, it was the reason I fetched CVS - it did not work
in patched pws-12 as well) cd into $cdpath does not work. I tracked it down to:

+_alternative:62> action=( _path_files -W \(/home/bor /home/bor/src /tools/src
/archive/sni/dbase\) -/ )
+_alternative:63> _path_files -J -default- -W (/home/bor /home/bor/src
/tools/src/archive/sni/dbase) -/
+

The relevant lines in _alternative are:

        action=( $=action )
        ${(e)action[1]} "$subopts[@]" "$expl[@]" "${(@e)~action[2,-1]}"

In other words, _every_ action with SP in argument is doomed because it is
splitted in multiple arguments. This is a general problem.

In case of _cd this results from:

    _alternative \
        'local-directories:local directories:_path_files -/' \
        "path-directories: directories in cdpath:_path_files -W
\\(${${(@)cdpath:#.}}\\) -/"

I don't see, why should we exclude `.'. If it is in cdpath and user requested
path-directories - why not?

/andrej


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: cd completion does not work in CVS version (unsafe word splitting in _alternative).
  1999-12-23 14:58 cd completion does not work in CVS version (unsafe word splitting in _alternative) Andrej Borsenkow
@ 1999-12-23 15:57 ` Andrej Borsenkow
  0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 1999-12-23 15:57 UTC (permalink / raw)
  To: ZSH workers mailing list


>         ${(e)action[1]} "$subopts[@]" "$expl[@]" "${(@e)~action[2,-1]}"

Sorry, this was already edited (but does not work for the same reason). The
correct is, 'course,

${(e)action[1]} "$subopts[@]" "$expl[@]" ${(e)~action[2,-1]}

/andrej


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-12-23 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-23 14:58 cd completion does not work in CVS version (unsafe word splitting in _alternative) Andrej Borsenkow
1999-12-23 15:57 ` Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).