The branch main has been updated by des:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5af240c54bd2d9548536c904e841499e1651bcc8

commit 5af240c54bd2d9548536c904e841499e1651bcc8
Author:     Dag-Erling Smørgrav <[email protected]>
AuthorDate: 2025-11-26 16:54:52 +0000
Commit:     Dag-Erling Smørgrav <[email protected]>
CommitDate: 2025-11-26 16:56:42 +0000

    libc: Simplify __get_locale()
    
    MFC after:      1 week
    Sponsored by:   Klara, Inc.
    Reviewed by:    fuz
    Differential Revision:  https://reviews.freebsd.org/D53908
---
 lib/libc/locale/xlocale_private.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/libc/locale/xlocale_private.h 
b/lib/libc/locale/xlocale_private.h
index ef1a8687a376..4cb323d5fa4c 100644
--- a/lib/libc/locale/xlocale_private.h
+++ b/lib/libc/locale/xlocale_private.h
@@ -200,11 +200,9 @@ extern _Thread_local locale_t __thread_locale;
  */
 static inline locale_t __get_locale(void)
 {
-
-       if (!__has_thread_locale) {
+       if (!__has_thread_locale || __thread_locale == NULL)
                return (&__xlocale_global_locale);
-       }
-       return (__thread_locale ? __thread_locale : &__xlocale_global_locale);
+       return (__thread_locale);
 }
 
 /**

Reply via email to