Hello Willy,

Le vendredi 13 mai 2016 à 19:22 +0200, Willy Tarreau a écrit :
> Maxime, could you please add a call to setlocale(LC_ALL, "") as
> suggested by Nenad before starting to scan the directories ? If
> something isn't 100% clear to you, do not hesitate to ask for more
> details, you won't look stupid, I did before you :-)

It's clear.
I didn't know either that I had to call setlocale to get the locale
from the environment. I read the man strcoll and thought it would use
LC_COLLATE (from the environment) without other call.

I add the setlocale call in the main function because it doesn't set
any haproxy variable. But "init" also sound like a good place.
Let me know if you prefer to move setlocale from main.

        $ LC_COLLATE='fr_FR.utf8' ls -l rootdir/aaa
        total 0
        -rw-r--r-- 1 max users 0 13 mai   22:17 a.cfg
        -rw-r--r-- 1 max users 0 13 mai   22:18 A.cfg
        -rw-r--r-- 1 max users 0 13 mai   22:17 à.cfg
        -rw-r--r-- 1 max users 0 13 mai   22:18 À.cfg
        -rw-r--r-- 1 max users 0 13 mai   22:17 â.cfg
        -rw-r--r-- 1 max users 0 13 mai   22:18 Â.cfg
        $ LC_COLLATE='fr_FR.utf8' ./haproxy -C rootdir -f aaa 
        aaa/a.cfg
        aaa/A.cfg
        aaa/à.cfg
        aaa/À.cfg
        aaa/â.cfg
        aaa/Â.cfg
        $ LC_COLLATE=C ./haproxy -C rootdir -f aaa 
        aaa/A.cfg
        aaa/a.cfg
        aaa/À.cfg
        aaa/Â.cfg
        aaa/à.cfg
        aaa/â.cfg

-- 
Regards
Maxime de Roucy

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to