From 5f59a34ab747dde8ede7357f3431bf06bd6002fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 8 Mar 2026 17:28:33 +0100 Subject: New upstream version 1.4.2 --- lib/localename-environ.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'lib/localename-environ.c') diff --git a/lib/localename-environ.c b/lib/localename-environ.c index 0d35d6bb..8985fe48 100644 --- a/lib/localename-environ.c +++ b/lib/localename-environ.c @@ -1,5 +1,5 @@ /* Determine name of the currently selected locale. - Copyright (C) 1995-2025 Free Software Foundation, Inc. + Copyright (C) 1995-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -27,32 +27,36 @@ const char * gl_locale_name_environ (_GL_UNUSED int category, const char *categoryname) { - const char *retval; - /* Setting of LC_ALL overrides all other. */ - retval = getenv ("LC_ALL"); - if (retval != NULL && retval[0] != '\0') - return retval; + { + const char *retval = getenv ("LC_ALL"); + if (retval != NULL && retval[0] != '\0') + return retval; + } /* Next comes the name of the desired category. */ - retval = getenv (categoryname); - if (retval != NULL && retval[0] != '\0') - return retval; + { + const char *retval = getenv (categoryname); + if (retval != NULL && retval[0] != '\0') + return retval; + } /* Last possibility is the LANG environment variable. */ - retval = getenv ("LANG"); - if (retval != NULL && retval[0] != '\0') - { + { + const char *retval = getenv ("LANG"); + if (retval != NULL && retval[0] != '\0') + { #if HAVE_CFPREFERENCESCOPYAPPVALUE - /* Mac OS X 10.2 or newer. - Ignore invalid LANG value set by the Terminal application. */ - if (!streq (retval, "UTF-8")) + /* Mac OS X 10.2 or newer. + Ignore invalid LANG value set by the Terminal application. */ + if (!streq (retval, "UTF-8")) #endif #if defined __CYGWIN__ - /* Cygwin. - Ignore dummy LANG value set by ~/.profile. */ - if (!streq (retval, "C.UTF-8")) + /* Cygwin. + Ignore dummy LANG value set by ~/.profile. */ + if (!streq (retval, "C.UTF-8")) #endif - return retval; - } + return retval; + } + } return NULL; } -- cgit v1.2.3