From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27861 invoked by alias); 2 Jun 2011 14:14:01 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29435 Received: (qmail 3603 invoked from network); 2 Jun 2011 14:13:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110602071346.ZM15593@torch.brasslantern.com> Date: Thu, 02 Jun 2011 07:13:46 -0700 In-reply-to: <4DE765F2.5000704@sergio.spb.ru> Comments: In reply to sergio "Re: strange completion" (Jun 2, 2:29pm) References: <4DE6ABF6.10405@sergio.spb.ru> <110601194609.ZM14369@torch.brasslantern.com> <4DE765F2.5000704@sergio.spb.ru> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org, sergio Subject: PATCH (?) Re: strange completion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii [>zsh-workers] On Jun 2, 2:29pm, sergio wrote: } Subject: Re: strange completion } } This is list-dirs-first bug. } If I comment this string: } zstyle ':completion:*' list-dirs-first true } all works fine. Hmm; this is actually a problem (?) in _path_files when evaluating the "fake-files" style. I'm not sure whether the following is the correct fix, or whether that entire if/elif/else cascade should be wrapped in if [[ -n "$fake" ]]; then because all the branches pass a (possibly empty) $fake to compfiles. Index: Completion/Unix/Type/_path_files =================================================================== --- Completion/Unix/Type/_path_files 1 Jun 2011 06:39:59 -0000 +++ Completion/Unix/Type/_path_files 2 Jun 2011 14:07:00 -0000 @@ -438,7 +438,7 @@ tmp2=( "$tmp1[@]" ) - if [[ "$tpre$tsuf" = */* ]]; then + if [[ "$tpre$tsuf" = */* && -n "$fake" ]]; then compfiles -P$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" "$sdirs" fake elif [[ "$sopt" = *[/f]* ]]; then compfiles -p$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" "$sdirs" fake "$pats[@]"