From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9504 invoked from network); 1 Mar 2008 00:58:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Mar 2008 00:58:10 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 11584 invoked from network); 1 Mar 2008 00:58:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Mar 2008 00:58:06 -0000 Received: (qmail 19291 invoked by alias); 1 Mar 2008 00:58:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24643 Received: (qmail 19278 invoked from network); 1 Mar 2008 00:58:03 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 1 Mar 2008 00:58:03 -0000 Received: from acolyte.scowler.net (acolyte.scowler.net [216.254.112.45]) by bifrost.dotsrc.org (Postfix) with ESMTP id 28C2B8026E0B for ; Sat, 1 Mar 2008 01:57:59 +0100 (CET) Received: by acolyte.scowler.net (Postfix, from userid 1000) id 3CF855C1A4; Fri, 29 Feb 2008 19:57:54 -0500 (EST) Date: Fri, 29 Feb 2008 19:57:55 -0500 From: Clint Adams To: zsh-workers@sunsite.dk, Adrian Irving-Beer , 468654@bugs.debian.org Subject: Re: Bug#468654: zsh: rsync completion fails to complete remote paths with spaces Message-ID: <20080301005755.GA3807@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk, Adrian Irving-Beer , 468654@bugs.debian.org References: <20080229200414.GA3027@wisq.net> <20080229202150.GA18766@scowler.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080229202150.GA18766@scowler.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Scanned: ClamAV 0.91.2/6049/Sat Mar 1 01:23:02 2008 on bifrost X-Virus-Status: Clean On Fri, Feb 29, 2008 at 03:21:50PM -0500, Clint Adams wrote: > Maybe _rsync should get the same QIPREFIX check as _ssh and _git, or > maybe all three of these should be factored out into a helper function. Adrian, does this do the trick? Index: Completion/Unix/Command/_rsync =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_rsync,v retrieving revision 1.39 diff -u -r1.39 _rsync --- Completion/Unix/Command/_rsync 15 Dec 2007 16:45:38 -0000 1.39 +++ Completion/Unix/Command/_rsync 1 Mar 2008 00:54:56 -0000 @@ -58,7 +58,11 @@ elif compset -P 1 '*:'; then if zstyle -T ":completion:${curcontext}:files" remote-access; then - remfiles=(${(M)${(f)"$(_call_program files ssh -a -x ${IPREFIX%:} ls -d1FL "${(Q)PREFIX%%[^./][^/]#}\*" 2>/dev/null)"}%%[^/]#(|/)}) + if [[ -z $QIPREFIX ]] + then rempat="${PREFIX%%[^./][^/]#}\*" + else rempat="${(q)PREFIX%%[^./][^/]#}\*" + fi + remfiles=(${(M)${(f)"$(_call_program files ssh -a -x ${IPREFIX%:} ls -d1FL "$rempat" 2>/dev/null)"}%%[^/]#(|/)}) compset -P '*/' compset -S '/*' || suf='remote file'