Bad sort order under glibc 2.2

Dmitry Yu. Bolkhovityanov D.Yu.Bolkhovityanov at inp.nsk.su
Wed Jul 11 14:42:52 UTC 2001


On 11 Jul 01 at 16:10, jakub at redhat.com wrote:

> >     BTW, there's one more problem -- filenames of various cases are mixed, so
> > that "README", "INSTALL", "Makefile" etc. go *after* e.g. configure.in.  But
> > the same problem affects "ls", so this one should definitely be reported to
> > glibc team (strange, but I found nothing about this in their bug-tracking
> > system).
>
> There is nothing to report, glibc is correct.
> glibc strcoll sorts according to locale collation sequence, and most native
> languages sort that way, look at any printed vocabulary.
> Some people are not used to this since computers weren't doing this
> previously and people are expecting C locale sorting.
> If mc wants to sort differently (e.g. putting dot files first makes a lot of
> sense), then it has to ensure it itself before calling strcoll.

    Sure.  Dot-files *must* be sorted separately (as well as directories),
and this does require special logic in mc (in fact, relying on ASCII sort
order here is a bad thing).

    But changing case-sensitivity of file sort order is not good too -- there
is a long ago established practice of naming "important" files with a leading
capital, for those to be desplayed first (README, Makefile vs. makefile,
etc.), and this practice is documented.  Oh, mamma mia, do we need a
strnocasecoll()? ;-)  Somebody of POSIX-writers should have thought about
this issue before...


       ___________________________________________________________________
       Dmitry Yu. Bolkhovityanov  |  Novosibirsk, RUSSIA
       phone (383-2)-39-49-56     |  The Budker Institute of Nuclear Physics
                                  |  Lab. 5-13




More information about the mc mailing list