* PATCH: Re: completing directory path
@ 2000-07-10 8:01 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-07-10 8:01 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-07-10 8:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-10 8:01 PATCH: Re: completing directory path Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).