Subject: Re: Incorrect sorting of Polish characters
From: Peter Stephenson <[email-masked]>
To: [email-masked]
Date: Mon, 18 Jul 2016 10:33:29 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Sat, 16 Jul 2016 13:07:18 -0700
Bart Schaefer <[email-masked]> wrote:
> On Jul 16,  7:17pm, M. Bartoszkiewicz wrote:
> }
> } I have noticed that some Polish characters
> } are sorted incorrectly in glob expansion (but
> } correctly in other contexts).
> 
> Both parameter expansion and globbing are using qsort() and each
> passes a pointer to a function that calls strcoll() underneath, so I
> suspect this is a (removal of) metafication issue, because that's
> done in the parameter function but not in the globbing one.

A simple-minded change to pass strcoll() unmetafied versions of the
strings does seem to fix the problem, so it looks like this is the
case.  However, that's not the right fix as we only want to unmetafy
once per input string, not once per comparison, and below the call to
qsort() there's quite a lot of internal string handling.  An equally
simple-minded fix around the call to qsort() (saving and restoring the
strings) didn't seem to work.  So this needs a bit more thought.

This should be added to the tests when it's passing.

pws