From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10229 invoked by alias); 25 Sep 2014 02:42:57 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19144 Received: (qmail 12950 invoked from network); 25 Sep 2014 02:42:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.2 Date: Thu, 25 Sep 2014 10:32:41 +0800 From: Han Pingtian To: zsh-users@zsh.org Subject: Re: append mark qualifier disturbs sort qualifier? Message-ID: <20140925023241.GA2900@localhost.localdomain> Mail-Followup-To: zsh-users@zsh.org References: <20140924092404.GB3248@localhost.localdomain> <20140924192757.051379ea@pws-pc.ntlworld.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140924192757.051379ea@pws-pc.ntlworld.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14092502-5806-0000-0000-00000095F204 On Wed, Sep 24, 2014 at 07:27:57PM +0100, Peter Stephenson wrote: > On Wed, 24 Sep 2014 17:24:04 +0800 > Han Pingtian wrote: > > localhost% print -l **/*(odonT) > > 2/3/4/ > > 2/3/4/5.txt > > 2/3/4/6.txt > > 2/ > > 2/3/ > > > > Here, looks like "(T)" disturbs the sorting of "(odon)"? > > Aha. > > diff --git a/Src/glob.c b/Src/glob.c > index c24bfec..ca7bc44 100644 > --- a/Src/glob.c > +++ b/Src/glob.c > @@ -900,6 +900,9 @@ gmatchcmp(Gmatch a, Gmatch b) > /* Count slashes. Trailing slashes don't count. */ > while (*aptr && *aptr == *bptr) > aptr++, bptr++; > + /* Like I just said... */ > + if ((!*aptr || !*bptr) && aptr > a->name && aptr[-1] == '/') > + aptr--, bptr--; > if (*aptr) > for (; aptr[1]; aptr++) > if (*aptr == '/') { > This patch works just fine. Thanks!