public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: /proc/locales: filter out useless explicit utf8 locales Date: Sun, 26 Mar 2023 12:18:21 +0000 (GMT) [thread overview] Message-ID: <20230326121821.F06FA3858C50@sourceware.org> (raw) 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; }
reply other threads:[~2023-03-26 12:18 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230326121821.F06FA3858C50@sourceware.org \ --to=corinna@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).