zsh-workers
 help / color / mirror / code / Atom feed
From: Jay Berkenbilt <ejb@ql.org>
To: clint@zsh.org
Cc: zsh-workers@sunsite.dk, 243385@bugs.debian.org
Subject: Re: [ejb@ql.org: Bug#243385: zsh: rsync completion expands * too soon]
Date: Tue, 13 Apr 2004 12:17:33 -0400	[thread overview]
Message-ID: <200404131617.i3DGHX7s031305@soup.acv.apexcovantage.com> (raw)
In-Reply-To: <20040413021931.GA10355@scowler.net> (clint@zsh.org)


>   > Yes.  Well, kind of.  It's an eval issue.  The call to _call_program
>   > (which I have removed) causes the wildcard to be expanded too early
>   > because it calls eval.  Here's a trace excerpt.
>
>   I haven't tried this at all, but maybe this will fix your problem.

>   [removed patch that encloses ls args in ""]

Yes, this works and has the advantage that it doesn't clobber any
other advantage of using _call_program.  I would still suggest adding
"L" to the ls arguments so that valid (non-dangling) symbolic links to
directories complete with a trailing slash.

Off hand, I'm not able to think of a compelling reason why this would
fail.  It seems to behave properly even with double quote characters
or spaces in the file name (as does my original patch).

To me, something feels cleaner and safer about avoiding the
unnecessary eval than enclosing everything in an extra set of quotes,
This will probably break if _call_program is changed to do what it
does differently.  On the other hand, since I'll admit to not
completely understanding what the purpose of _call_program is (it
looks to me like it provides a mechanism for using zstyle to tell zsh
that command names should be completed at a given point in expanding a
program's argument), I wouldn't try to argue that my original patch is
better.

Note that _ssh and _rlogin both have remote_files functions that do
not call _call_program.  _ssh used to before my previous patch but now
doesn't.

Here's a new patch that is identical to yours except that it adds the
"L" to the ls arguments.

--- _rsync.qdist	2004-03-25 13:29:33.000000000 -0500
+++ _rsync	2004-04-13 12:11:36.000000000 -0400
@@ -37,8 +37,8 @@
 
   if zstyle -T ":completion:${curcontext}:" remote-access; then
     slash=/
-    remfiles=(${(f)"$(_call_program files ssh -a -x ${words[CURRENT]%:*} ls -d1F ${${${words[CURRENT
-]#*:}:h}/${slash}(#e)/}/\* 2>/dev/null)"})
+    remfiles=(${(f)"$(_call_program files ssh -a -x ${words[CURRENT]%:*} ls -d1FL "${${${words[CURRENT
+]#*:}:h}/${slash}(#e)/}/\* 2>/dev/null")"})
 
     remdispf=(${remfiles:#*/})
     remdispd=(${(M)remfiles:#*/})



-- 
Jay Berkenbilt <ejb@ql.org>
http://www.ql.org/q/


  reply	other threads:[~2004-04-13 16:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-13  1:21 Clint Adams
2004-04-13  1:37 ` Jay Berkenbilt
2004-04-13  2:19   ` Clint Adams
2004-04-13 16:17     ` Jay Berkenbilt [this message]
2004-04-13 17:44       ` Bart Schaefer
2004-04-13 22:55         ` Clint Adams
2004-04-14 16:37           ` more boring zsh-in-Arch chatter [was Re: [ejb@ql.org: Bug#243385: zsh: rsync completion expands * too soon]] Clint Adams
2004-04-25  2:07             ` more boring zsh-in-Arch chatter Clint Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200404131617.i3DGHX7s031305@soup.acv.apexcovantage.com \
    --to=ejb@ql.org \
    --cc=243385@bugs.debian.org \
    --cc=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).