From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21094 invoked from network); 22 Jun 2005 01:30:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Jun 2005 01:30:33 -0000 Received: (qmail 39504 invoked from network); 22 Jun 2005 01:30:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Jun 2005 01:30:27 -0000 Received: (qmail 12781 invoked by alias); 22 Jun 2005 01:30:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21370 Received: (qmail 12772 invoked from network); 22 Jun 2005 01:30:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Jun 2005 01:30:25 -0000 Received: (qmail 39211 invoked from network); 22 Jun 2005 01:30:25 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 22 Jun 2005 01:30:21 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 251B370058; Tue, 21 Jun 2005 21:30:19 -0400 (EDT) Date: Tue, 21 Jun 2005 21:30:18 -0400 From: Clint Adams To: Bart Schaefer Cc: zsh-workers@sunsite.dk, Hugo Haas , Debian Bug Tracking System <315255@bugs.debian.org> Subject: Re: Bug#315255: zsh: cvs commit completion breaks on spaces Message-ID: <20050622013018.GA10774@scowler.net> Mail-Followup-To: Bart Schaefer , zsh-workers@sunsite.dk, Hugo Haas , Debian Bug Tracking System <315255@bugs.debian.org> References: <20050621142441.GA32423@larve.net> <20050621175055.GA25622@scowler.net> <1050622005745.ZM22841@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1050622005745.ZM22841@candle.brasslantern.com> User-Agent: Mutt/1.5.9i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 > See if this isn't better. The substitution isn't that much less hairy, > but it doesn't fork and it doesn't depend on splitting on spaces. It certainly looks better, but the filenames are still being split on spaces, so if one touches "blah argh" and "blah", and cvs add's them, then cvs commit will complete "blah" and "argh". $pat will be something like "blah argh|blah" Adding the parens makes it do the right thing in this particular case. What's the correct fix? Index: _cvs =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_cvs,v retrieving revision 1.25 diff -u -r1.25 _cvs --- _cvs 11 May 2005 09:27:10 -0000 1.25 +++ _cvs 22 Jun 2005 01:26:49 -0000 @@ -868,9 +868,12 @@ : ${PREFIX:#(#b)(*/)(*)} linedir="$match[1]" realdir=${(e)~linedir} - [[ -f "$realdir"CVS/Entries ]] && - [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/${slash}[^${slash}]#${slash}//}%/[^/]#/[^/]#}:#${(j:|:)~${${${${(f)"$(LC_ALL=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${realdir}*(D) 2>/dev/null)"}##*/}/ //}//(#m)[][*?()<|^~#\\]/\\$MATCH}}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]] && - _wanted files expl 'modified file' _path_files -g "$pat" + [[ -f "$realdir"CVS/Entries ]] && { + local -a mtime + LC_ALL=C builtin stat -A mtime -gn +mtime -F $'%a %b %e %T %Y\n' ${realdir}*(D) 2>/dev/null + [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/${slash}[^${slash}]#${slash}//}%/[^/]#/[^/]#}:#${(j:|:)~${(f)${(j:/:)${mtime##*/}}//(#m)[][*?()<|^~#\\]/\\$MATCH}#/}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]] + } && + _wanted files expl 'modified file' _path_files -g "($pat)" else _cvs_existing_entries fi