public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] Cygwin: /proc/locales: filter out useless explicit utf8 locales
@ 2023-03-26 12:18 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2023-03-26 12:18 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=80cea279426fbb03f4954bb8be88fb1a2b5e320b

commit 80cea279426fbb03f4954bb8be88fb1a2b5e320b
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Sun Mar 26 14:12:13 2023 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Sun Mar 26 14:12:13 2023 +0200

    Cygwin: /proc/locales: filter out useless explicit utf8 locales
    
    Fixes: c42b98bdc665f ("Cygwin: introduce /proc/codesets and /proc/locales")
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler/proc.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/winsup/cygwin/fhandler/proc.cc b/winsup/cygwin/fhandler/proc.cc
index 961e894736c3..0e60c519ef79 100644
--- a/winsup/cygwin/fhandler/proc.cc
+++ b/winsup/cygwin/fhandler/proc.cc
@@ -2240,8 +2240,9 @@ format_proc_locale_proc (LPWSTR win_locale, DWORD info, LPARAM param)
   __set_charset_from_locale (posix_loc_and_modifier, codeset);
   *bufptr_p = add_locale (*bufptr_p, posix_loc, codeset, false, modifier,
 			  win_locale);
-  *bufptr_p = add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier,
-			  win_locale);
+  if (strcmp (codeset, "UTF-8") != 0)
+    *bufptr_p = add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier,
+			    win_locale);
 
   /* Only one cross each */
   if (modifier[0])
@@ -2274,8 +2275,9 @@ format_proc_locale_proc (LPWSTR win_locale, DWORD info, LPARAM param)
   __set_charset_from_locale (posix_loc_and_modifier, codeset);
   *bufptr_p = add_locale (*bufptr_p, posix_loc, codeset, false, modifier,
 			  win_locale);
-  *bufptr_p = add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier,
-			  win_locale);
+  if (strcmp (codeset, "UTF-8") != 0 && strcmp (modifier, "@euro") != 0)
+    *bufptr_p = add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier,
+			    win_locale);
 
   return TRUE;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-26 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 12:18 [newlib-cygwin/main] Cygwin: /proc/locales: filter out useless explicit utf8 locales Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).