Commit f7efd84e authored by Bruno Haible's avatar Bruno Haible
Browse files

localename: Optimize code for native Windows.

* lib/localename.c (gl_locale_name_posix): Remove handling of LC_ALL
category (not allowed here).
parent 505092c2
2019-12-18 Bruno Haible <bruno@clisp.org>
localename: Optimize code for native Windows.
* lib/localename.c (gl_locale_name_posix): Remove handling of LC_ALL
category (not allowed here).
2019-12-18 Bruno Haible <bruno@clisp.org>
 
setlocale: Make calls with NULL argument multithread-safe.
......@@ -133,7 +139,7 @@
2019-12-17 Bruno Haible <bruno@clisp.org>
 
localcharset: Optimize code for native Windows.
* lib/localcharset.c (locale_charset): Don't both calling
* lib/localcharset.c (locale_charset): Don't bother calling
setlocale (LC_ALL, NULL) since we're not interested in its result.
 
2019-12-17 Bruno Haible <bruno@clisp.org>
......@@ -3242,19 +3242,11 @@ gl_locale_name_posix (int category, const char *categoryname)
if (LC_MIN <= category && category <= LC_MAX)
{
const char *locname = setlocale (category, NULL);
LCID lcid;
/* If CATEGORY is LC_ALL, the result might be a semi-colon
separated list of locales. We need only one, so we take the
one corresponding to LC_CTYPE, as the most important for
character translations. */
if (category == LC_ALL && strchr (locname, ';'))
locname = setlocale (LC_CTYPE, NULL);
/* Convert locale name to LCID. We don't want to use
LocaleNameToLCID because (a) it is only available since Vista,
and (b) it doesn't accept locale names returned by 'setlocale'. */
lcid = get_lcid (locname);
LCID lcid = get_lcid (locname);
if (lcid > 0)
return gl_locale_name_from_win32_LCID (lcid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment