From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id F06FA3858C50; Sun, 26 Mar 2023 12:18:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F06FA3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679833101; bh=HtWzCoh2Bvx7/Br9QIv0srr1nddEm6/LD0RWjnetux0=; h=From:To:Subject:Date:From; b=qiKYGV7cvG+IH1VovCa482o4mzvaYMDyWfZoXtNJw4c9EF/q6hLyTQ35UuNA+ycRJ CCWSwvmsHouKBjiViMrdEofEu3C6+BY67vlRU5J6x8ey6dj5/8AOQGK65LQAy7UkkT bDAVk1/7tU4ntvAhjNKwNMvtbUjPnZDe47Wt3c08= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: /proc/locales: filter out useless explicit utf8 locales X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 2d5492453a4aef0b761800cd89fd41b11af6c2d3 X-Git-Newrev: 80cea279426fbb03f4954bb8be88fb1a2b5e320b Message-Id: <20230326121821.F06FA3858C50@sourceware.org> Date: Sun, 26 Mar 2023 12:18:21 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D80cea279426= fbb03f4954bb8be88fb1a2b5e320b commit 80cea279426fbb03f4954bb8be88fb1a2b5e320b Author: Corinna Vinschen AuthorDate: Sun Mar 26 14:12:13 2023 +0200 Commit: Corinna Vinschen CommitDate: Sun Mar 26 14:12:13 2023 +0200 Cygwin: /proc/locales: filter out useless explicit utf8 locales =20 Fixes: c42b98bdc665f ("Cygwin: introduce /proc/codesets and /proc/local= es") Signed-off-by: Corinna Vinschen 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 inf= o, LPARAM param) __set_charset_from_locale (posix_loc_and_modifier, codeset); *bufptr_p =3D add_locale (*bufptr_p, posix_loc, codeset, false, modifier, win_locale); - *bufptr_p =3D add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier, - win_locale); + if (strcmp (codeset, "UTF-8") !=3D 0) + *bufptr_p =3D add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifie= r, + win_locale); =20 /* Only one cross each */ if (modifier[0]) @@ -2274,8 +2275,9 @@ format_proc_locale_proc (LPWSTR win_locale, DWORD inf= o, LPARAM param) __set_charset_from_locale (posix_loc_and_modifier, codeset); *bufptr_p =3D add_locale (*bufptr_p, posix_loc, codeset, false, modifier, win_locale); - *bufptr_p =3D add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier, - win_locale); + if (strcmp (codeset, "UTF-8") !=3D 0 && strcmp (modifier, "@euro") !=3D = 0) + *bufptr_p =3D add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifie= r, + win_locale); =20 return TRUE; }