From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12112 invoked from network); 30 Sep 1997 12:42:59 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 30 Sep 1997 12:42:59 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id IAA08293; Tue, 30 Sep 1997 08:27:50 -0400 (EDT) Resent-Date: Tue, 30 Sep 1997 08:27:50 -0400 (EDT) Date: Tue, 30 Sep 1997 16:28:36 +0400 (MSD) From: Andrej Borsenkow X-Sender: bor@itsrm1 Reply-To: borsenkow.msk@sni.de To: Zsh workers mailing list Subject: ZSH 3.0.5 breaks script Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"p6kKi1.0.T12.61FCq"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3542 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi! I installed 3.0.5, and since then my script for cd completion doesn't work. I wrote it long ago (pre 3.x.x) and never changed since then (I know, it could look better ... ;) Currently I get: bor@itsmx1:~%> cdTAB bor@itsmx1:~%> cd ${temp_reply}/ instead of listing choices. setopt gives: autoparamslash autoremoveslash nobanghist nobeep extendedglob histignoredups ignoreeof interactive nolistbeep listtypes login magicequalsubst menucomplete monitor nonomatch numericglobsort shinstdin zle compctl for cd is: cd -qUQ -K multi_cd_comp -S / where multi_cd_comp is local pref head sofar origtop newtop globdir="(-/)" wild cdpath_dirs i origpref temp_reply setopt localoptions nullglob rcexpandparam globdots unsetopt markdirs globsubst shwordsplit pref="${1}$2" # Hack to allow programmable completion to select multicomp after a : # (e.g. # compctl -D -f -x 's[:]' -U -K multicomp # ) pref="${pref#:}" origpref="${pref}" if [[ "$pref" == [/\~]* ]]; then cdpath_dirs=('') else cdpath_dirs=("${cdpath[@]:-''}") fi reply=() temp_reply=('') for i in "${cdpath_dirs[@]}"; do sofar=('') origtop="" if [[ -n "${i}" ]]; then pref=${i}/${origpref} else pref=${origpref} fi if [[ "$pref" = \~* ]]; then # If the string started with ~, save the head and what it will become. origtop="${pref%%/*}" newtop=${~origtop} # Save the expansion as the bit matched already sofar=($newtop) pref="${pref#$origtop}" fi while [[ -n "$pref" ]]; do [[ "$pref" = /* ]] && sofar=(${sofar}/) && pref="${pref#/}" head="${pref%%/*}" pref="${pref#$head}" if [[ -n "$pref" && -z $sofar[2] && -d "${sofar}$head" ]]; then # Exactly matched directory: don't try to glob temp_reply=("${sofar}$head") else # if path segment contains wildcards, don't add another. if [[ "$head" = *[\*\?]* ]]; then wild= else wild='*' fi temp_reply=(${sofar}"${head}${wild}${globdir}") temp_reply=(${~temp_reply}) fi [[ -z $temp_reply[1] ]] && temp_reply=() && break [[ -n $pref ]] && sofar=($temp_reply) done # Restore ~'s in front if there were any. # There had better not be anything funny in $newtop. [[ -n "${i}" ]] && temp_reply=(${temp_reply#${i}/}) if [[ -n "$origtop" ]]; then reply=(${reply} "$origtop"${temp_reply#$newtop}) else reply=(${reply} ${temp_reply}) fi done What's wrong? ------------------------------------------------------------------------- Andrej Borsenkow Fax: +7 (095) 252 01 05 SNI ITS Moscow Tel: +7 (095) 252 13 88 NERV: borsenkow.msk E-Mail: borsenkow.msk@sni.de -------------------------------------------------------------------------