From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6281 invoked from network); 3 Jul 2003 11:24:32 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Jul 2003 11:24:32 -0000 Received: (qmail 26703 invoked by alias); 3 Jul 2003 11:24:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18796 Received: (qmail 26658 invoked from network); 3 Jul 2003 11:24:27 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 3 Jul 2003 11:24:27 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 3 Jul 2003 11:24:26 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.cambridgesiliconradio.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Wed, 2 Jul 2003 12:23:59 +0100 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 3 Jul 2003 12:23:41 +0100 To: zsh-workers@sunsite.dk Subject: Re: Bug in autocompletion in CVS In-reply-to: "Vincent Driessen"'s message of "Thu, 03 Jul 2003 10:43:52 +0200." <20030703084352.GB24884@turkish> Date: Thu, 03 Jul 2003 12:24:24 +0100 Message-ID: <478.1057231464@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 03 Jul 2003 11:23:41.0686 (UTC) FILETIME=[8E980960:01C34155] Vincent Driessen wrote: > I discovered a small bug in the version in pkgsrc/zsh. In a directory that > contains filenames with spaces, you cannot use the tabcompletion properly whe > n > issueing a CVS command, for example, with these commands: > > % /foo> ls > CVS/ foo > bar this is a file name with spaces > % /foo> cvs upd th[TAB] > > The filename part of the command is only expanded until the "this". Bang to rights... I think the following simplified version works, although I don't really know why it was so complicated in the first place, so please say if this has side effects. I think there may be a similar problem when checking for modified files, but as the test is currently [[ -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" I don't feel like investigating more closely at the moment. (Is that the World's Longest Ever Shell Substitution?) Index: Completion/Unix/Command/_cvs =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_cvs,v retrieving revision 1.19 diff -u -r1.19 _cvs --- Completion/Unix/Command/_cvs 8 May 2003 10:30:48 -0000 1.19 +++ Completion/Unix/Command/_cvs 3 Jul 2003 11:20:40 -0000 @@ -912,8 +912,8 @@ linedir="$match[1]" realdir=${(e)~linedir} [[ -f "$realdir"CVS/Entries ]] && - [[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}}"} ]] && - _wanted files expl file _path_files -g "$pat" + pat=(${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}%%/*}) + (( ${#pat} )) && _wanted files expl file _path_files -a pat } (( $+functions[_cvs_modified_entries] )) || -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************