From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7980 invoked from network); 13 Apr 2004 16:24:41 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Apr 2004 16:24:41 -0000 Received: (qmail 27027 invoked by alias); 13 Apr 2004 16:24:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19769 Received: (qmail 24490 invoked from network); 13 Apr 2004 16:17:45 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Apr 2004 16:17:45 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Apr 2004 16:17:45 -0000 Received: (qmail 24158 invoked from network); 13 Apr 2004 16:17:45 -0000 Received: from through.apexcovantage.com (HELO through.acv.apexcovantage.com) (65.166.131.3) by a.mx.sunsite.dk with SMTP; 13 Apr 2004 16:17:42 -0000 Received: from apex.acv.apexcovantage.com (apex.acv.apexcovantage.com [192.168.0.1]) by through.acv.apexcovantage.com (8.12.8/8.12.8/apexcovantage-gateway-1.0) with ESMTP id i3DGHZBi005022; Tue, 13 Apr 2004 12:17:35 -0400 Received: from soup.acv.apexcovantage.com (soup.acv.apexcovantage.com [192.168.0.5]) by apex.acv.apexcovantage.com (8.12.8/8.12.8/ads-apexcovantage-hub-1.0) with ESMTP id i3DGHY30008274; Tue, 13 Apr 2004 12:17:34 -0400 Received: from soup.acv.apexcovantage.com (soup [127.0.0.1]) by soup.acv.apexcovantage.com (8.12.11/8.12.11/Debian-3) with ESMTP id i3DGHXM5031309; Tue, 13 Apr 2004 12:17:33 -0400 Received: (from ejb@localhost) by soup.acv.apexcovantage.com (8.12.11/8.12.11/Debian-3) id i3DGHX7s031305; Tue, 13 Apr 2004 12:17:33 -0400 Date: Tue, 13 Apr 2004 12:17:33 -0400 Message-Id: <200404131617.i3DGHX7s031305@soup.acv.apexcovantage.com> From: Jay Berkenbilt To: clint@zsh.org CC: zsh-workers@sunsite.dk, 243385@bugs.debian.org In-reply-to: <20040413021931.GA10355@scowler.net> (clint@zsh.org) Subject: Re: [ejb@ql.org: Bug#243385: zsh: rsync completion expands * too soon] References: <20040413012117.GA9729@scowler.net> <200404130137.i3D1b5CW004764@soup.in.ql.org> <20040413021931.GA10355@scowler.net> X-Apex-MailScanner-Information: Scanned by Apex with MailScanner X-Apex-MailScanner: Found to be clean X-MailScanner-From: ejb@apexcovantage.com X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 > > 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 http://www.ql.org/q/