Re: my dreams about gtk/freebsd...
- From: Owen Taylor <otaylor redhat com>
- To: "pixel" <pixel epita fr>
- Cc: <gtk-list redhat com>
- Subject: Re: my dreams about gtk/freebsd...
- Date: 02 May 1999 21:48:09 -0400
"pixel" <firstname.lastname@example.org> writes:
> Hi Lords,
> I'm angry about this setlocale() stuff.
> The fact is :
> when you have LC_MESSAGES on your system, a
> setlocale(LC_MESSAGES,NULL) can return NULL. This will
> end with a segfault (in gtk_rc_init(), for
> example, you'll :
> locale = setlocale(LC_MESSAGES,NULL);
> if (strcmp(locale,"C") && strcmp(locale,"POSIX"))
> /* do stuff */
> Since locale is NULL, you'll understand that this may lead
> to problems). So it *is* necessary to test the setlocale()
However, it's bizarre, and almost certainly a bug in
FreeBSD that this does return NULL.
The typical case where setlocale returns NULL is when
you try to _change_ the locale. Here, we are only
querying the locale. So, this seems to imply that
FreeBSD defines a LC_MESSAGES constant but barfs
when you try to query the current setting of that
We can put a workaround into GTK+ (it won't be
the first...); the obvious one is if querying
LC_MESSAGES returns NULL, fall back to querying
LC_CTYPE as we do on systems that don't define
a LC_MESSAGES constant.
You might want to ask the FreeBSD people why
that happens, though...
] [Thread Prev