This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11009] `nl_langinfo_l (item, LC_GLOBAL_LOCALE)' crashes
- From: "bruno at clisp dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 24 Nov 2009 01:12:31 -0000
- Subject: [Bug libc/11009] `nl_langinfo_l (item, LC_GLOBAL_LOCALE)' crashes
- References: <20091123224038.11009.ludo@gnu.org>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From bruno at clisp dot org 2009-11-24 01:12 -------
(In reply to comment #3)
> If you want to query the global locale, why don't you just use
> nl_langinfo instead of nl_langinfo_l?
Note that the proposed
nl_langinfo_l (item, LC_GLOBAL_LOCALE)
is not equivalent to
nl_langinfo (item)
but rather to
({ locale_t old_thread_locale = uselocale (LC_GLOBAL_LOCALE);
const char *value = nl_langinfo (item);
uselocale (old_thread_locale);
value;
})
or to
({ locale_t global_locale = duplocale (LC_GLOBAL_LOCALE);
const char *value = nl_langinfo_l (item, global_locale);
freelocale (global_locale);
value;
})
But I agree with your evaluation that it is not essential to support
LC_GLOBAL_LOCALE arguments here (unlike in duplocale, see bug10969).
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11009
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.