public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Fix UTF-16 surrogate handling in wctomb and friends.
@ 2015-05-29 13:56 Corinna Vinschen
0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2015-05-29 13:56 UTC (permalink / raw)
To: cygwin-cvs, newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9b42474f293d068dcaa65f2f20ca268c51c960ec
commit 9b42474f293d068dcaa65f2f20ca268c51c960ec
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Wed Apr 1 15:31:18 2015 +0200
Fix UTF-16 surrogate handling in wctomb and friends.
* libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a
lone high surrogate.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
newlib/ChangeLog | 5 +++++
newlib/libc/stdlib/wctomb_r.c | 2 +-
winsup/cygwin/release/1.7.36 | 3 +++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index e615421..a5a31c7 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-01 Corinna Vinschen <vinschen@redhat.com>
+
+ * libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a
+ lone high surrogate.
+
2015-03-31 Corinna Vinschen <vinschen@redhat.com>
* libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside
diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c
index 13e1e4c..c93962f 100644
--- a/newlib/libc/stdlib/wctomb_r.c
+++ b/newlib/libc/stdlib/wctomb_r.c
@@ -74,7 +74,7 @@ _DEFUN (__utf8_wctomb, (r, s, wchar, charset, state),
return 0; /* UTF-8 encoding is not state-dependent */
if (sizeof (wchar_t) == 2 && state->__count == -4
- && (wchar < 0xdc00 || wchar >= 0xdfff))
+ && (wchar < 0xdc00 || wchar > 0xdfff))
{
/* There's a leftover lone high surrogate. Write out the CESU-8 value
of the surrogate and proceed to convert the given character. Note
diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/1.7.36
index 21175c9..0515ef9 100644
--- a/winsup/cygwin/release/1.7.36
+++ b/winsup/cygwin/release/1.7.36
@@ -35,3 +35,6 @@ Bug Fixes
- Avoid potential crash at startup or in getgroups(2).
Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00010.html
+
+- Fix UTF-16 surrogate handling in wctomb and friends.
+ Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00452.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* [newlib-cygwin] Fix UTF-16 surrogate handling in wctomb and friends.
@ 2015-04-01 13:32 Corinna Vinschen
0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2015-04-01 13:32 UTC (permalink / raw)
To: cygwin-cvs, newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=829c8f6c2dc1b849f5037ce7b27f4b7b00b257e9
commit 829c8f6c2dc1b849f5037ce7b27f4b7b00b257e9
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Wed Apr 1 15:31:18 2015 +0200
Fix UTF-16 surrogate handling in wctomb and friends.
* libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a
lone high surrogate.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
newlib/ChangeLog | 5 +++++
newlib/libc/stdlib/wctomb_r.c | 2 +-
winsup/cygwin/release/1.7.36 | 3 +++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index e615421..a5a31c7 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-01 Corinna Vinschen <vinschen@redhat.com>
+
+ * libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a
+ lone high surrogate.
+
2015-03-31 Corinna Vinschen <vinschen@redhat.com>
* libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside
diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c
index 13e1e4c..c93962f 100644
--- a/newlib/libc/stdlib/wctomb_r.c
+++ b/newlib/libc/stdlib/wctomb_r.c
@@ -74,7 +74,7 @@ _DEFUN (__utf8_wctomb, (r, s, wchar, charset, state),
return 0; /* UTF-8 encoding is not state-dependent */
if (sizeof (wchar_t) == 2 && state->__count == -4
- && (wchar < 0xdc00 || wchar >= 0xdfff))
+ && (wchar < 0xdc00 || wchar > 0xdfff))
{
/* There's a leftover lone high surrogate. Write out the CESU-8 value
of the surrogate and proceed to convert the given character. Note
diff --git a/winsup/cygwin/release/1.7.36 b/winsup/cygwin/release/1.7.36
index 21175c9..0515ef9 100644
--- a/winsup/cygwin/release/1.7.36
+++ b/winsup/cygwin/release/1.7.36
@@ -35,3 +35,6 @@ Bug Fixes
- Avoid potential crash at startup or in getgroups(2).
Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00010.html
+
+- Fix UTF-16 surrogate handling in wctomb and friends.
+ Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00452.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-29 13:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-29 13:56 [newlib-cygwin] Fix UTF-16 surrogate handling in wctomb and friends Corinna Vinschen
-- strict thread matches above, loose matches on Subject: below --
2015-04-01 13:32 Corinna Vinschen
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).