From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id DE4283858421; Mon, 31 Jul 2023 20:52:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE4283858421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690836733; bh=6l/eiJJROfHWDt+SRmLhfzVhEgEiqfvU/Npl+YTVeKc=; h=From:To:Subject:Date:From; b=P97GCR1uuzIJWv3TNVx8mRc+oB3OlHkpt98SDf9vv5yJYpoJ0VSkqMpFnwvPB/Ifa 4sKBAqCoR3771Kd8WJzF/jFrKGz8/qbD1I1iaWkjo5pptGIc251He54PEuzu6ZUdGo L/DzljoTOlX0/J99116nrpExkGwzXxwjvrmtaDAE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] Revert "* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion of" X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 4f78215c866a2e1a7cd1ba894772029fa19d8328 X-Git-Newrev: 8a4318943875cd922601d34e54ce8a83ad2e733c Message-Id: <20230731205213.DE4283858421@sourceware.org> Date: Mon, 31 Jul 2023 20:52:13 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D8a431894387= 5cd922601d34e54ce8a83ad2e733c commit 8a4318943875cd922601d34e54ce8a83ad2e733c Author: Corinna Vinschen AuthorDate: Mon Jul 31 12:44:16 2023 +0200 Commit: Corinna Vinschen CommitDate: Mon Jul 31 22:39:09 2023 +0200 Revert "* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion = of" =20 This reverts commit 2b77087a48ea56e77fca5aeab478c922f6473d7c. =20 For some reason lost in time, commit 2b77087a48ea5 introduced Cygwin-specific code treating single byte characters outside the portable character set as illegal chars. However, Cygwin was always alone with this over-correct behaviour and it leads to stuff like gnulib replacing functions defined in Cygwin with their own implementation just due to that. =20 Revert this change, sans the changes to ChangeLog. =20 Fixes: 2b77087a48ea ("* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disall= ow conversion of") Signed-off-by: Corinna Vinschen Diff: --- newlib/libc/stdlib/mbtowc_r.c | 8 -------- newlib/libc/stdlib/wctomb_r.c | 4 ---- 2 files changed, 12 deletions(-) diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c index 01e596db8bde..cab8333d70df 100644 --- a/newlib/libc/stdlib/mbtowc_r.c +++ b/newlib/libc/stdlib/mbtowc_r.c @@ -36,14 +36,6 @@ __ascii_mbtowc (struct _reent *r, if (n =3D=3D 0) return -2; =20 -#ifdef __CYGWIN__ - if ((wchar_t)*t >=3D 0x80) - { - _REENT_ERRNO(r) =3D EILSEQ; - return -1; - } -#endif - *pwc =3D (wchar_t)*t; =20 if (*t =3D=3D '\0') diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c index 3081e9370271..5ea1e13e48a3 100644 --- a/newlib/libc/stdlib/wctomb_r.c +++ b/newlib/libc/stdlib/wctomb_r.c @@ -29,11 +29,7 @@ __ascii_wctomb (struct _reent *r, if (s =3D=3D NULL) return 0; =20 -#ifdef __CYGWIN__ - if ((size_t)wchar >=3D 0x80) -#else if ((size_t)wchar >=3D 0x100) -#endif { _REENT_ERRNO(r) =3D EILSEQ; return -1;