From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26825 invoked from network); 29 Jun 2000 08:09:03 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Jun 2000 08:09:03 -0000 Received: (qmail 14032 invoked by alias); 29 Jun 2000 08:08:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12118 Received: (qmail 14014 invoked from network); 29 Jun 2000 08:08:31 -0000 Date: Thu, 29 Jun 2000 10:08:29 +0200 (MET DST) Message-Id: <200006290808.KAA04297@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Danek Duvall's message of Thu, 29 Jun 2000 00:18:09 -0700 Subject: PATCH: Re: couple of problems with _expand Danek Duvall wrote: > These are with 3.1.9-dev-1. I can replicate with zsh -f, running compinit, > and setting the only completer to _expand. > > 1) > % echo -$COL > > leaves > > % echo - Oops. Better don't try to expand with such a partially typed parameter expansion. > 2) > % echo ${ZSH_ > _expand:58: bad substitution This is already fixed. Bye Sven Index: Completion/Core/_expand =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v retrieving revision 1.22 diff -u -r1.22 _expand --- Completion/Core/_expand 2000/06/29 07:10:31 1.22 +++ Completion/Core/_expand 2000/06/29 08:07:06 @@ -33,7 +33,9 @@ word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX" fi -[[ "$word" = *\$\{[^\}]# ]] && return 1 +[[ "$word" = *\$(|\{[^\}]#) || + ( "$word" = *\$[a-zA-Z0-9_]## && $+parameters[${word##*\$}] -eq 0 ) ]] && + return 1 zstyle -T ":completion:${curcontext}:" suffix && [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] && @@ -44,8 +46,8 @@ { [[ "$word" = \~(|[-+]) || ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) || ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -ne 1 ) || - ( "$word" = \$[a-zA-Z0-9_]## && - ${#parameters[(I)${word[2,-1]}*]} -ne 1 ) ]] && return 1 } + ( "$word" = *\$[a-zA-Z0-9_]## && + ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && return 1 } # In exp we will collect the expansions. -- Sven Wischnowsky wischnow@informatik.hu-berlin.de