Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: append mark qualifier disturbs sort qualifier?
- X-seq: zsh-users 19143
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-user <zsh-users@xxxxxxx>
- Subject: Re: append mark qualifier disturbs sort qualifier?
- Date: Wed, 24 Sep 2014 19:27:57 +0100
- In-reply-to: <20140924092404.GB3248@localhost.localdomain>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20140924092404.GB3248@localhost.localdomain>
On Wed, 24 Sep 2014 17:24:04 +0800
Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> 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 <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author