]> Savannah Git Hosting - gnulib.git/commitdiff
localename-unsafe: Use getlocalename_l-unsafe.
authorBruno Haible <bruno@clisp.org>
Sat, 22 Feb 2025 17:18:53 +0000 (18:18 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 22 Feb 2025 18:00:06 +0000 (19:00 +0100)
* lib/localename-unsafe.c: Include getlocalename_l-unsafe.h.
(gl_locale_name_thread_unsafe): Invoke getlocalename_l_unsafe instead of
getlocalename_l.
* modules/localename-unsafe (Depends-on): Add getlocalename_l-unsafe.
Remove getlocalename_l-simple.
* modules/localename-unsafe-limited (Depends-on): Likewise.

ChangeLog
lib/localename-unsafe.c
modules/localename-unsafe
modules/localename-unsafe-limited

index dd437a98b74e6b84173ce5c8d1df7c61ce6cea9e..3f9a7bb6187489fb9c4e00c23b5759e204b9ed51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-02-22  Bruno Haible  <bruno@clisp.org>
+
+       localename-unsafe: Use getlocalename_l-unsafe.
+       * lib/localename-unsafe.c: Include getlocalename_l-unsafe.h.
+       (gl_locale_name_thread_unsafe): Invoke getlocalename_l_unsafe instead of
+       getlocalename_l.
+       * modules/localename-unsafe (Depends-on): Add getlocalename_l-unsafe.
+       Remove getlocalename_l-simple.
+       * modules/localename-unsafe-limited (Depends-on): Likewise.
+
 2025-02-22  Bruno Haible  <bruno@clisp.org>
 
        getlocalename_l-unsafe: New module.
index 569bf9ba993874bcb29cb84ee88420c4562db444..a058281f5bfb1a8a9b5aa598a7179045f8d9aa84 100644 (file)
@@ -34,6 +34,7 @@
 #include <locale.h>
 #include <string.h>
 
+#include "getlocalename_l-unsafe.h"
 #include "setlocale_null.h"
 
 #if HAVE_GOOD_USELOCALE
@@ -2622,7 +2623,11 @@ gl_locale_name_thread_unsafe (int category, _GL_UNUSED const char *categoryname)
   {
     locale_t thread_locale = uselocale (NULL);
     if (thread_locale != LC_GLOBAL_LOCALE)
-      return getlocalename_l (category, thread_locale);
+      {
+        struct string_with_storage ret =
+          getlocalename_l_unsafe (category, thread_locale);
+        return ret.value;
+      }
   }
 #endif
   /* On WINDOWS_NATIVE, don't use GetThreadLocale() here, because when
index b7d073deeafa803bbb967eaf306cf38825b05c95..01ab5a42d08b6e5fa66f283a576e8708806413f0 100644 (file)
@@ -18,7 +18,7 @@ extensions
 locale-h
 strdup
 lock
-getlocalename_l-simple
+getlocalename_l-unsafe
 setlocale-null-unlocked
 
 configure.ac:
index 51e8b1e8826786f76d15e8a2f727db65260995d9..9ca367e48c17aac971b0102e207a473434938a31 100644 (file)
@@ -13,7 +13,7 @@ m4/lcmessage.m4
 Depends-on:
 extensions
 locale-h
-getlocalename_l-simple
+getlocalename_l-unsafe
 setlocale-null-unlocked
 
 configure.ac: