From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26882 invoked from network); 28 Mar 2001 10:55:55 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Mar 2001 10:55:55 -0000 Received: (qmail 2513 invoked by alias); 28 Mar 2001 10:55:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13813 Received: (qmail 2495 invoked from network); 28 Mar 2001 10:55:48 -0000 Date: Wed, 28 Mar 2001 12:55:48 +0200 (MET DST) Message-Id: <200103281055.MAA14996@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.dk In-reply-to: "Bart Schaefer"'s message of Wed, 28 Mar 2001 06:30:36 +0000 Subject: Re: PATCH: MH for Mailboxes (TM) Bart Schaefer wrote: > On Mar 26, 10:34am, Sven Wischnowsky wrote: > } > } Bart Schaefer wrote: > } > } > By the way (Sven), when I complete after "mutt -f " (with no prefix in > } > the current word) I -still- get a blank item as the first menu-selection. > } > I thought we fixed that bug a long time ago? > } > } Yes, sounds very familiar. I don't remember exactly and since I don't > } use anything I could complete with _mailboxes I can't easily try, but > } normally that's because one of the expansions leaves an empty element > } in an array. > > I've looked through _complete_debug output and not managed to find any > cases where `compadd' is called with an array containing an empty element. > > However, at _multi_parts line 164-166, the expression > > "${(@)${(@M)matches:#*${sep}}%%${sep}*}" > > expands to the empty string. Could that be the source of the problem? Yes, that may be. Even if it doesn't fix this particular problem, the patch below should only make things saver. Can someone try? Bye Sven Index: Completion/Core/_multi_parts =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_multi_parts,v retrieving revision 1.5 diff -u -r1.5 _multi_parts --- Completion/Core/_multi_parts 2001/02/09 14:01:58 1.5 +++ Completion/Core/_multi_parts 2001/03/28 10:53:10 @@ -163,14 +163,14 @@ compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \ -p "$pref" "$tmp2[@]" -M "r:|${sep}=* r:|=* $matcher" - \ - "${(@)${(@M)matches:#*${sep}}%%${sep}*}" && ret=0 + "${(@)${(@)${(@M)matches:#*${sep}}%%${sep}*}:#}" && ret=0 (( $matches[(I)${sep}*] )) && compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \ -p "$pref" \ -M "r:|${sep}=* r:|=* $matcher" - "$sep" && ret=0 compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \ -p "$pref" "$tmp2[@]" -M "r:|${sep}=* r:|=* $matcher" - \ - "${(@)${(@M)matches:#*?${sep}?*}%%${sep}*}" && ret=0 + "${(@)${(@)${(@M)matches:#*?${sep}?*}%%${sep}*}:#}" && ret=0 compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" -p "$pref" "$tmp2[@]" \ -M "r:|${sep}=* r:|=* $matcher" - \ "${(@)matches:#*${sep}*}" && ret=0 @@ -182,7 +182,7 @@ compadd "$group[@]" "$expl[@]" "$opts[@]" \ -p "$pref" -s "${i#*${sep}}" \ -M "r:|${sep}=* r:|=* $matcher" - \ - "${(@)${(@M)matches:#*${sep}*}%%${sep}*}" && ret=0 + "${(@)${(@)${(@M)matches:#*${sep}*}%%${sep}*}:#}" && ret=0 compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" -p "$pref" \ -M "r:|${sep}=* r:|=* $matcher" - \ "${(@)matches:#*${sep}*}" && ret=0 -- Sven Wischnowsky wischnow@informatik.hu-berlin.de