From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12115 invoked from network); 10 Jul 2000 08:01:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 Jul 2000 08:01:50 -0000 Received: (qmail 872 invoked by alias); 10 Jul 2000 08:01:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12208 Received: (qmail 865 invoked from network); 10 Jul 2000 08:01:38 -0000 Date: Mon, 10 Jul 2000 10:01:35 +0200 (MET DST) Message-Id: <200007100801.KAA18437@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Fri, 07 Jul 2000 17:12:52 +0100 Subject: PATCH: Re: completing directory path Peter Stephenson wrote: > completion has stopped working on ~1/... etc. > > % pushd ~1/^D > > works OK but > > % pushd ~1/D^D_main_complete:153: command not found: 1 > _main_complete:153: command not found: 1 > > Completing `directory' or `corrections' Uh oh. _path_files was using tmp=... but didn't declare tmp, only tmp[1-4], so it set the one from _main_complete. This should also fix the inserted `+' problem. Bye Sven Index: Completion/Core/_path_files =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v retrieving revision 1.25 diff -u -r1.25 _path_files --- Completion/Core/_path_files 2000/07/04 08:07:25 1.25 +++ Completion/Core/_path_files 2000/07/10 08:00:59 @@ -209,21 +209,23 @@ elif [[ "$linepath" = ([-+]|)[0-9]## ]]; then if [[ "$linepath" != [-+]* ]]; then if [[ -o pushdminus ]]; then - linepath="-$linepath" + tmp1="-$linepath" else - linepath="+$linepath" + tmp1="+$linepath" fi + else + tmp1="$linepath" fi if [[ "$linepath" = -* ]]; then - tmp=$(( $#dirstack $linepath )) + tmp1=$(( $#dirstack $tmp1 )) else - tmp=$linepath[2,-1] + tmp1=$tmp1[2,-1] fi - [[ -o pushdminus ]] && tmp=$(( $#dirstack - $tmp )) - if (( ! tmp )); then + [[ -o pushdminus ]] && tmp1=$(( $#dirstack - $tmp1 )) + if (( ! tmp1 )); then realpath=$PWD/ - elif [[ tmp -le $#dirstack ]]; then - realpath=$dirstack[tmp]/ + elif [[ tmp1 -le $#dirstack ]]; then + realpath=$dirstack[tmp1]/ else _message 'not enough directory stack entries' return 1 -- Sven Wischnowsky wischnow@informatik.hu-berlin.de