Revert "* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion of"

This reverts commit 2b77087a48.

For some reason lost in time, commit 2b77087a48 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.

Revert this change, sans the changes to ChangeLog.

Fixes: 2b77087a48 ("* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion of")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2023-07-31 12:44:16 +02:00
parent 4f78215c86
commit 8a43189438
2 changed files with 0 additions and 12 deletions

View File

@ -36,14 +36,6 @@ __ascii_mbtowc (struct _reent *r,
if (n == 0) if (n == 0)
return -2; return -2;
#ifdef __CYGWIN__
if ((wchar_t)*t >= 0x80)
{
_REENT_ERRNO(r) = EILSEQ;
return -1;
}
#endif
*pwc = (wchar_t)*t; *pwc = (wchar_t)*t;
if (*t == '\0') if (*t == '\0')

View File

@ -29,11 +29,7 @@ __ascii_wctomb (struct _reent *r,
if (s == NULL) if (s == NULL)
return 0; return 0;
#ifdef __CYGWIN__
if ((size_t)wchar >= 0x80)
#else
if ((size_t)wchar >= 0x100) if ((size_t)wchar >= 0x100)
#endif
{ {
_REENT_ERRNO(r) = EILSEQ; _REENT_ERRNO(r) = EILSEQ;
return -1; return -1;