From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 686 invoked from network); 8 Mar 1999 10:33:05 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Mar 1999 10:33:05 -0000 Received: (qmail 28 invoked by alias); 8 Mar 1999 10:32:30 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5679 Received: (qmail 21 invoked from network); 8 Mar 1999 10:32:27 -0000 Date: Mon, 8 Mar 1999 11:31:42 +0100 (MET) Message-Id: <199903081031.LAA11761@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Mon, 8 Mar 1999 11:03:38 +0100 (MET) Subject: Re: PATCH: _long_options Aargh, I remembered this a bit too late... If `_long_options' thinks the command invoked is a path name relative to PWD it probably should put `$PWD' before it to make sure the cache isn't used for another command that happens to have the same name but is in a different directory. I had this idea when playing with `_tar' (which is not changed, yet): there we probably should try to turn the archive name into a absolute path when building the cache name. Would tf="$PWD/$tf" tf="${${tf//.\\/}//\\/[^/]#\\/..}" be enough for that? (Looks funny, doesn't it? ;-) Bye Sven diff -u oc/User/_long_options Completion/User/_long_options --- oc/User/_long_options Mon Mar 8 11:22:18 1999 +++ Completion/User/_long_options Mon Mar 8 11:28:43 1999 @@ -58,11 +58,17 @@ # We cache the information about options and the command name, see if # we can use the cache. -if [[ "$words[1]" != $_lo_cache_cmd ]]; then +if [[ "$words[1]" = (.|..)/* ]]; then + tmp="$PWD/$words[1]" +else + tmp="$words[1]" +fi + +if [[ "$tmp" != $_lo_cache_cmd ]]; then # No, store the new command name and clear the old parameters. - _lo_cache_cmd="$words[1]" + _lo_cache_cmd="$tmp" (( $+_lo_cache_actions )) && unset ${_lo_cache_actions%% *} _lo_cache_actions local opts pattern anum=1 tmpo str -- Sven Wischnowsky wischnow@informatik.hu-berlin.de