This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/11009] `nl_langinfo_l (item, LC_GLOBAL_LOCALE)' crashes


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]