From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17465 invoked by alias); 24 Sep 2014 20:08:44 -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: 19143 Received: (qmail 28250 invoked from network); 24 Sep 2014 20:08:41 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [80.3.229.105] X-Spam: 0 X-Authority: v=2.1 cv=Cq4xcxID c=1 sm=1 tr=0 a=uz1KDxDNIq33yePw376BBA==:117 a=uz1KDxDNIq33yePw376BBA==:17 a=NLZqzBF-AAAA:8 a=RKgIEPXiehkA:10 a=UqEuY3k8bQMA:10 a=uObrxnre4hsA:10 a=kj9zAlcOel0A:10 a=VnNF1IyMAAAA:8 a=OixekqBqbZ4ITZdETdgA:9 a=CjuIK1q_8ugA:10 a=_dQi-Dcv4p4A:10 Date: Wed, 24 Sep 2014 19:27:57 +0100 From: Peter Stephenson To: zsh-user Subject: Re: append mark qualifier disturbs sort qualifier? Message-ID: <20140924192757.051379ea@pws-pc.ntlworld.com> In-Reply-To: <20140924092404.GB3248@localhost.localdomain> References: <20140924092404.GB3248@localhost.localdomain> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 == '/') { -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/