From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25535 invoked from network); 2 Jan 2002 17:08:58 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 2 Jan 2002 17:08:58 -0000 Received: (qmail 17766 invoked by alias); 2 Jan 2002 17:08:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4561 Received: (qmail 17755 invoked from network); 2 Jan 2002 17:08:47 -0000 X-VirusChecked: Checked X-Authentication-Warning: iris.logica.co.uk: Host kiddleo@rambo.logica.co.uk [158.234.33.58] claimed to be yahoo.co.uk Sender: kiddleo@iris.logica.co.uk Message-ID: <3C333E7D.24B06CA3@yahoo.co.uk> Date: Wed, 02 Jan 2002 17:08:14 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.16-686-smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Vincent Lefevre CC: zsh-users@sunsite.dk Subject: Re: Completion bug (unzip) References: <20020101154601.GA2706@ay.nerim.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Vincent Lefevre wrote: > > Happy new year! > > I've found another bug concerning the unzip completion. Consider the > following line: > > unzip ../archive/newhtml.zip dir/fi_ -d directory > > where the cursor is just after dir/fi (represented by an underscore). > If I hit the [Tab] key, I get the error: This is probably due to the rather poor code for finding the zipfile's name which handled zip nicely but not unzip. Using $line makes the job much easier. Why didn't I think of that when I first wrote it. I'd appreciate if you could check this - I haven't been able to exactly reproduce the problem as you described (with the zipinfo error). Oliver Index: Completion/Unix/Command/_zip =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_zip,v retrieving revision 1.4 diff -u -r1.4 _zip --- Completion/Unix/Command/_zip 2001/12/06 16:52:33 1.4 +++ Completion/Unix/Command/_zip 2002/01/02 17:07:59 @@ -1,6 +1,6 @@ #compdef zip unzip zipinfo -local suffixes suf zipfile izip uzi +local suffixes suf zipfile uzi local expl curcontext="$curcontext" state line typeset -A opt_args @@ -114,9 +114,7 @@ if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then _files -g '^(#i)*.(zip|[jw]ar)' && return 0 else - (( izip = 1 + words[(I)-[^xi]*] )) - (( izip == 1 )) && (( izip++ )) - zipfile=( $~words[izip](|.zip|.ZIP) ) + zipfile=( $~line[1](|.zip|.ZIP) ) [[ -z $zipfile[1] ]] && return 1 if [[ $zipfile[1] != $_zip_cache_list ]]; then _zip_cache_name="$zipfile[1]" This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a pro-active anti-virus service working around the clock, around the globe visit http://www.messagelabs.com/