From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16676 invoked from network); 2 Mar 1999 09:17:14 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Mar 1999 09:17:14 -0000 Received: (qmail 16467 invoked by alias); 2 Mar 1999 09:17:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5599 Received: (qmail 16454 invoked from network); 2 Mar 1999 09:17:00 -0000 Date: Tue, 2 Mar 1999 10:16:18 +0100 (MET) Message-Id: <199903020916.KAA17070@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: more example cleanup `_path_files' had some problems with completion after `./' and `../' and `_comp_parts' had problems if the array of possible matches it builds contained empty strings. Bye Sven diff -u oc/Core/_comp_parts Completion/Core/_comp_parts --- oc/Core/_comp_parts Mon Mar 1 13:13:15 1999 +++ Completion/Core/_comp_parts Tue Mar 2 09:11:21 1999 @@ -65,6 +65,7 @@ _match_pattern _comp_parts test matchflags test="${matchflags}${test}" testarr=( "${(@M)${(@P)arr}:#${~test}*}" ) + testarr=( "${(@)testarr:#}" ) # If there are no matches we give up. If there is more than one # match, this is the part we will complete. @@ -91,6 +92,7 @@ _match_pattern _comp_parts test matchflags test="${matchflags}${test}" testarr=( "${(@M)${(@P)arr}:#${~test}*}" ) + testarr=( "${(@)testarr:#}" ) fi [[ $#testarr -eq 0 || ${#testarr[1]} -eq 0 ]] && return @@ -124,7 +126,9 @@ tmparr=( ${=arr[2,-2]} ) arr=tmparr fi - suffixes=("${^suffixes[@]}${1}${(@M)^${(@P)arr}:#${~test}*}") + tmparr=( "${(@M)${(@P)arr}:#${~test}*}" ) + tmparr=( "${(@)testarr:#}" ) + suffixes=("${^suffixes[@]}${1}$^tmparr") # We want the completion code to generate the most specific suffix # for us, so we collect matching specifications that allow partial diff -u oc/Core/_path_files Completion/Core/_path_files --- oc/Core/_path_files Mon Mar 1 18:22:59 1999 +++ Completion/Core/_path_files Tue Mar 2 09:16:37 1999 @@ -183,7 +183,7 @@ # have special meaning for globbing, we remove them. But before that, we # add the pattern for matching any characters before a slash. -patstr="$patstr:gs-/-*/-:gs/*.*.//:gs-/*.-/.-:gs/**/*/" +patstr="$patstr:gs-/-*/-:gs/*.*.//:gs-/*.-/.-:gs/**/*/:gs-.*/-./-" # First we skip over all pathname components in `str' which really exist in # the file-system, so that `/usr/lib/l' doesn't offer you `lib' and -- Sven Wischnowsky wischnow@informatik.hu-berlin.de