1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-10 00:31:07 +02:00

avoid insertion of `+' before ~1/<TAB>; don't use undeclared local $tmp (12208)

This commit is contained in:
Sven Wischnowsky 2000-07-10 08:03:36 +00:00
parent 709c31e9a8
commit 961876dca4
2 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2000-07-10 Sven Wischnowsky <wischnow@zsh.org>
* 12208: Completion/Core/_path_files: avoid insertion of `+'
before ~1/<TAB>; don't use undeclared local $tmp
2000-07-08 Tanaka Akira <akr@zsh.org> 2000-07-08 Tanaka Akira <akr@zsh.org>
* 12201: Completion/User/_java: fix completion for jar. complete * 12201: Completion/User/_java: fix completion for jar. complete

View file

@ -209,21 +209,23 @@ if [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then
elif [[ "$linepath" = ([-+]|)[0-9]## ]]; then elif [[ "$linepath" = ([-+]|)[0-9]## ]]; then
if [[ "$linepath" != [-+]* ]]; then if [[ "$linepath" != [-+]* ]]; then
if [[ -o pushdminus ]]; then if [[ -o pushdminus ]]; then
linepath="-$linepath" tmp1="-$linepath"
else else
linepath="+$linepath" tmp1="+$linepath"
fi fi
else
tmp1="$linepath"
fi fi
if [[ "$linepath" = -* ]]; then if [[ "$linepath" = -* ]]; then
tmp=$(( $#dirstack $linepath )) tmp1=$(( $#dirstack $tmp1 ))
else else
tmp=$linepath[2,-1] tmp1=$tmp1[2,-1]
fi fi
[[ -o pushdminus ]] && tmp=$(( $#dirstack - $tmp )) [[ -o pushdminus ]] && tmp1=$(( $#dirstack - $tmp1 ))
if (( ! tmp )); then if (( ! tmp1 )); then
realpath=$PWD/ realpath=$PWD/
elif [[ tmp -le $#dirstack ]]; then elif [[ tmp1 -le $#dirstack ]]; then
realpath=$dirstack[tmp]/ realpath=$dirstack[tmp1]/
else else
_message 'not enough directory stack entries' _message 'not enough directory stack entries'
return 1 return 1