]> Savannah Git Hosting - gnulib.git/commitdiff
localename: Optimize code for native Windows.
authorBruno Haible <bruno@clisp.org>
Wed, 18 Dec 2019 14:07:05 +0000 (15:07 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 18 Dec 2019 14:07:05 +0000 (15:07 +0100)
* lib/localename.c (gl_locale_name_posix): Remove handling of LC_ALL
category (not allowed here).

ChangeLog
lib/localename.c

index 7d8b1c04e885940a7c83aafc8280ed8a69b43403..042b4c6354a3545a53997d437468da31b574cc2a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
 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>
index b6b94c274bc9e64f233e282a9233597522631847..d88743e4ce7a01d65370b8f89382ceaa0909bc7f 100644 (file)
@@ -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);