public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin/main] Revert "* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion of"
Date: Mon, 31 Jul 2023 20:52:13 +0000 (GMT)	[thread overview]
Message-ID: <20230731205213.DE4283858421@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8a4318943875cd922601d34e54ce8a83ad2e733c

commit 8a4318943875cd922601d34e54ce8a83ad2e733c
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Mon Jul 31 12:44:16 2023 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Mon Jul 31 22:39:09 2023 +0200

    Revert "* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion of"
    
    This reverts commit 2b77087a48ea56e77fca5aeab478c922f6473d7c.
    
    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.
    
    Revert this change, sans the changes to ChangeLog.
    
    Fixes: 2b77087a48ea ("* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion of")
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

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 == 0)
     return -2;
 
-#ifdef __CYGWIN__
-  if ((wchar_t)*t >= 0x80)
-    {
-      _REENT_ERRNO(r) = EILSEQ;
-      return -1;
-    }
-#endif
-
   *pwc = (wchar_t)*t;
   
   if (*t == '\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 == NULL)
     return 0;
  
-#ifdef __CYGWIN__
-  if ((size_t)wchar >= 0x80)
-#else
   if ((size_t)wchar >= 0x100)
-#endif
     {
       _REENT_ERRNO(r) = EILSEQ;
       return -1;

                 reply	other threads:[~2023-07-31 20:52 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=20230731205213.DE4283858421@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-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: link
Be 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).