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/localcharset.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/localcharset.c') 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 = ""; -- cgit v1.2.3