summaryrefslogtreecommitdiff
path: root/lib/localcharset.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
commit5f59a34ab747dde8ede7357f3431bf06bd6002fe (patch)
tree056a4477fd870d454d5be5868cddab829a47f4d2 /lib/localcharset.c
parent27dae84ed92f1ef0300263091972338d12e78348 (diff)
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'lib/localcharset.c')
-rw-r--r--lib/localcharset.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/localcharset.c b/lib/localcharset.c
index 79a55c5e..22dc38d3 100644
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -1,6 +1,6 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2006, 2008-2025 Free Software Foundation, Inc.
+ Copyright (C) 2000-2006, 2008-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
@@ -813,10 +813,9 @@ locale_charset (void)
environment variables (if present) or the codepage as a number. */
if (codeset != NULL && streq (codeset, "US-ASCII"))
{
- const char *locale;
static char resultbuf[2 + 10 + 1];
- locale = getenv ("LC_ALL");
+ const char *locale = getenv ("LC_ALL");
if (locale == NULL || locale[0] == '\0')
{
locale = getenv ("LC_CTYPE");
@@ -912,16 +911,13 @@ locale_charset (void)
# elif defined OS2
- const char *locale;
static char resultbuf[2 + 10 + 1];
- ULONG cp[3];
- ULONG cplen;
codeset = NULL;
/* Allow user to override the codeset, as set in the operating system,
with standard language environment variables. */
- locale = getenv ("LC_ALL");
+ const char *locale = getenv ("LC_ALL");
if (locale == NULL || locale[0] == '\0')
{
locale = getenv ("LC_CTYPE");
@@ -958,6 +954,9 @@ locale_charset (void)
if (codeset == NULL)
{
+ ULONG cp[3];
+ ULONG cplen;
+
/* OS/2 has a function returning the locale's codepage as a number. */
if (DosQueryCp (sizeof (cp), cp, &cplen))
codeset = "";