From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7568 invoked from network); 22 Jun 2005 00:58:02 -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 00:58:02 -0000 Received: (qmail 18843 invoked from network); 22 Jun 2005 00:57:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Jun 2005 00:57:56 -0000 Received: (qmail 7968 invoked by alias); 22 Jun 2005 00:57:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21369 Received: (qmail 7959 invoked from network); 22 Jun 2005 00:57:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Jun 2005 00:57:53 -0000 Received: (qmail 18448 invoked from network); 22 Jun 2005 00:57:53 -0000 Received: from vms048pub.verizon.net (206.46.252.48) by a.mx.sunsite.dk with SMTP; 22 Jun 2005 00:57:49 -0000 Received: from candle.brasslantern.com ([71.116.88.149]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IIG002BDO0BMZ85@vms048.mailsrvcs.net> for zsh-workers@sunsite.dk; Tue, 21 Jun 2005 19:57:48 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j5M0vkCw022843; Tue, 21 Jun 2005 17:57:47 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j5M0vkKq022842; Tue, 21 Jun 2005 17:57:46 -0700 Date: Wed, 22 Jun 2005 00:57:45 +0000 From: Bart Schaefer Subject: Re: Bug#315255: zsh: cvs commit completion breaks on spaces In-reply-to: <20050621175055.GA25622@scowler.net> To: Clint Adams , zsh-workers@sunsite.dk Cc: Hugo Haas , Debian Bug Tracking System <315255-forwarded@bugs.debian.org> Message-id: <1050622005745.ZM22841@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050621142441.GA32423@larve.net> <20050621175055.GA25622@scowler.net> Comments: In reply to Clint Adams "Re: Bug#315255: zsh: cvs commit completion breaks on spaces" (Jun 21, 1:50pm) 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=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Jun 21, 1:50pm, Clint Adams wrote: } } _cvs_modified_entries() doesn't like filenames with spaces. That's almost certainly because it's calling "builtin stat" and then parsing the output with the World's Hairiest Parameter Substitution (TM). Which is pretty silly given that stat can assign directly to an array without the need to fork a $(...) substitution. 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. Index: Src/_cvs =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Unix/Command/_cvs,v retrieving revision 1.17 diff -c -r1.17 _cvs --- Src/_cvs 28 May 2005 04:32:46 -0000 1.17 +++ Src/_cvs 22 Jun 2005 00:53:00 -0000 @@ -868,8 +868,11 @@ : ${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}"} ]] && + [[ -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