From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: zsh-users@zsh.org
Subject: Re: append mark qualifier disturbs sort qualifier?
Date: Thu, 25 Sep 2014 10:32:41 +0800 [thread overview]
Message-ID: <20140925023241.GA2900@localhost.localdomain> (raw)
In-Reply-To: <20140924192757.051379ea@pws-pc.ntlworld.com>
On Wed, Sep 24, 2014 at 07:27:57PM +0100, Peter Stephenson wrote:
> On Wed, 24 Sep 2014 17:24:04 +0800
> Han Pingtian <hanpt@linux.vnet.ibm.com> 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!
prev parent reply other threads:[~2014-09-25 2:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 9:24 Han Pingtian
2014-09-24 9:49 ` Peter Stephenson
2014-09-24 16:30 ` Bart Schaefer
2014-09-24 18:27 ` Peter Stephenson
2014-09-25 2:32 ` Han Pingtian [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140925023241.GA2900@localhost.localdomain \
--to=hanpt@linux.vnet.ibm.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).