From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id F0B2A3858431; Fri, 24 Mar 2023 11:52:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0B2A3858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679658726; bh=69l9Eu+DH/+lZeIiidoZ5+qfDqUDQzAym8Ll839Y0uE=; h=From:To:Subject:Date:From; b=T37ZWNDckFAmAtJSPuLFZcK36I/u++hiPZbLq59iA08VGUPQts6MuTAus8az3qxm4 rmbbr/gw1mfJLy6s99/0jzfK5aCP6av3ZejdjtIvsARwMHxp/QSdeYJkZ6PH2D7jX2 BeGG/BokZ/YRH22/HXd+w1vh9ppKEKzyYLVNxfCU= 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: fix "sr" locales X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 9296f134fb5aa808893d5bbf68b84d6b1edc193b X-Git-Newrev: 676796498defc0f26eb1c282c716785d20788b6f Message-Id: <20230324115206.F0B2A3858431@sourceware.org> Date: Fri, 24 Mar 2023 11:52:06 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D676796498de= fc0f26eb1c282c716785d20788b6f commit 676796498defc0f26eb1c282c716785d20788b6f Author: Corinna Vinschen AuthorDate: Fri Mar 24 11:50:42 2023 +0100 Commit: Corinna Vinschen CommitDate: Fri Mar 24 12:50:59 2023 +0100 Cygwin: /proc/locales: fix "sr" locales =20 The sr_XY locales are supposed to default to cyrillic, but the code always attached a @cyrillic, same reason as in the previous commit. =20 Special case "sr" further to workaround that issue. =20 Fixes: c42b98bdc665 ("Cygwin: introduce /proc/codesets and /proc/locale= s") Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/fhandler/proc.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler/proc.cc b/winsup/cygwin/fhandler/proc.cc index 3dc0421a53b4..b74c58a11d77 100644 --- a/winsup/cygwin/fhandler/proc.cc +++ b/winsup/cygwin/fhandler/proc.cc @@ -2178,8 +2178,12 @@ format_proc_locale_proc (LPWSTR win_locale, DWORD in= fo, LPARAM param) } /* Serbian: Windows default is Latin, Linux default is Cyrillic. We want the Linux default and attach @latin otherwise */ - else if (!wcscmp (iso639, L"sr") && !wcscmp (iso15924, L"Latn;")) - stpcpy (modifier, "@latin"); + else if (!wcscmp (iso639, L"sr")) + { + snprintf (posix_loc, sizeof posix_loc, "sr_%.27ls", iso3166); + if (!wcscmp (iso15924, L"Latn;")) + stpcpy (modifier, "@latin"); + } /* Tamazight: no modifier, iso639 is "ber" on Linux. "zgh-Tfng-MA" is equivalent to "ber_MA". */ else if (!wcscmp (iso639, L"zgh"))