[DragonFlyBSD - Bug #2415] setlocale() for unknown locales

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Fri Jun 13 03:05:01 PDT 2014


Issue #2415 has been updated by meand.


Your reading of my message was correct, but with a probability close to certainty
this issue was inadvertedly amended in commit 0d5acd74 by John Marino, whose commit
touched also the file "lib/libc/locale/setlocale.c".

For reference, the behaviour of 3.4 and 3.9:

$ uname -v
DragonFly v3.9.0.33.g96b40-DEVELOPMENT ...

setlocale(LC_ALL, "fake") = NULL

and identically for LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY,
LC_NUMERIC and LC_TIME.


$ uname -v
DragonFly v3.4.3-RELEASE ...

setlocale(LC_ALL, "fake") = "C/C/fake/fake/fake/C"

setlocale(LC_MONETARY, "fake") = "fake"
setlocale(LC_NUMERIC, "fake") = "fake"
setlocale(LC_TIME, "fake") = "fake"

but the correct value NULL is passed for LC_COLLATE, LC_CTYPE, LC_MESSAGES.

I must conclude that the issue #2415 can be closed for the current
development branch.

Best regards,
  Mats Erik Andersson

----------------------------------------
Bug #2415: setlocale() for unknown locales
http://bugs.dragonflybsd.org/issues/2415#change-12083

* Author: meand
* Status: New
* Priority: Normal
* Assignee: tuxillo
* Category: Userland
* Target version: 3.9.x
----------------------------------------
The return value of setlocale() for LC_ALL deviates from implementations
found in FreeBSD, NetBSD, GNU libc and OpenSolaris. Other implementations
return NULL for unknown locales and the category LC_ALL, where instead
DragonflyBSD isresponding with the internal value list.

Thus an environment variable LC_ALL=fake produces

    ### setlocale(LC_ALL, "");
    C/C/fake/fake/fake/C

    ### setlocale(LC_CTYPE, "");
    (null)

The LC_ALL category is hiding the erroneous effect from the
invoking program, whereas the other categories are correctly
reporting their failures.



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Bugs mailing list