[openbox] Patch: fix for setlocale problem

Ben Jansens ben at orodu.net
Mon Mar 31 13:42:32 EST 2003


On Mon, Mar 31, 2003 at 01:27:30PM +0200, Mike FABIAN wrote:

<snip>

> First it calls setlocale(LC_ALL, "") to make use of all locales
> specified by the environment variables, but doesn't use the return
> value.
> 
> Then it just queries the value of LC_MESSAGES by calling
> setlocale(LC_MESSAGES, NULL) and makes a copy of the return value
> which is then modified to find the translation file to use. The return
> value of setlocale(LC_MESSAGES, "") doesn't have the problem
> demonstrated above for the return value of setlocale(LC_ALL,""), it
> looks like it can safely be parsed to find the language subdirectory
> where to find the openbox.cat file with the translated messages.

Thanks for the patch. One quick note is I believe it would be preferable to
use a std::string to make a copy of the value instead of strdup. strdup is
not a portable function.

Ben
-- 
I am damn unsatisfied to be killed in this way.

http://www.icculus.org/openbox/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://icculus.org/pipermail/openbox/attachments/20030331/c4d21d5b/attachment.pgp>


More information about the openbox mailing list