summaryrefslogtreecommitdiff
path: root/lib/localename-environ.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/localename-environ.c')
-rw-r--r--lib/localename-environ.c44
1 files changed, 24 insertions, 20 deletions
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;
}