From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6195 invoked from network); 11 Jun 1999 08:24:40 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 Jun 1999 08:24:40 -0000 Received: (qmail 5516 invoked by alias); 11 Jun 1999 08:24:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6589 Received: (qmail 5509 invoked from network); 11 Jun 1999 08:24:26 -0000 Date: Fri, 11 Jun 1999 10:24:00 +0200 (MET DST) Message-Id: <199906110824.KAA25946@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: _path_files This replaces a ${...##*/} with ${...:t} and a ${...%/*} with ${...:h}. The :h isn't much faster, but the :t is. Significantly. Bye Sven diff -u oc/Core/_path_files Completion/Core/_path_files --- oc/Core/_path_files Thu Jun 10 21:10:33 1999 +++ Completion/Core/_path_files Thu Jun 10 21:17:40 1999 @@ -231,7 +231,7 @@ # See which of them match what's on the line. tmp2=("$tmp1[@]") - compadd -D tmp1 "$ignore[@]" - "${(@)tmp1##*/}" + compadd -D tmp1 "$ignore[@]" - "${(@)tmp1:t}" # If no file matches, save the expanded path and continue with # the outer loop. @@ -240,7 +240,7 @@ if [[ "$tmp2[1]" = */* ]]; then tmp2=( "${(@)tmp2#${prepath}${realpath}}" ) if [[ "$tmp2[1]" = */* ]]; then - exppaths=( "$exppaths[@]" ${^tmp2%/*}/${tpre}${tsuf} ) + exppaths=( "$exppaths[@]" ${^tmp2:h}/${tpre}${tsuf} ) else exppaths=( "$exppaths[@]" ${tpre}${tsuf} ) fi -- Sven Wischnowsky wischnow@informatik.hu-berlin.de