deterministic order for include by wildcard

Ondrej Zajicek santiago at crfreenet.org
Mon Dec 28 23:54:54 CET 2015


On Mon, Dec 28, 2015 at 08:42:19PM -0200, Henrique de Moraes Holschuh wrote:
> On Mon, 28 Dec 2015, Ondrej Zajicek wrote:
> > Results are alphabetically sorted. The wildcard expansion is implemented
> > by standard glob() libc function, and unfortunately both Single UNIX
> > specification and GNU C library documentation are lacking details about
> > that. I would expect that it is a plain ASCII, non-localized alphabetic sort.
> 
> In glibc, glob() is locale-aware and it will use the locale's collating
> order.
> ...
> That said, glibc will default the entire program to the C locale (or maybe
> C.UTF-8 nowadays), unless setlocale() has been called.
> 
> If you are working in an unknown locale, though (e.g. setlocale() was called
> to set the process locale to the system's locale), do *NOT* assume the
> sorting will look like what you'd get out of ASCII.

That is true, but we do not call setlocale(). That is the reason why i
would expect it to be a plain ASCII, non-localized alphabetic sort.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20151228/a3f46e4d/attachment.asc>


More information about the Bird-users mailing list