From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: completing directory path
Date: Mon, 10 Jul 2000 10:01:35 +0200 (MET DST) [thread overview]
Message-ID: <200007100801.KAA18437@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Fri, 07 Jul 2000 17:12:52 +0100
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
reply other threads:[~2000-07-10 8:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200007100801.KAA18437@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).