Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/strfuncs.cc1
2 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 74ca18851..b887f4200 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-08 IWAMURO Motonori <deenheart@gmail.com>
+
+ * strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting
+ wide char to SO/UTF-8 sequence.
+
2009-05-08 Corinna Vinschen <corinna@vinschen.de>
* include/sys/select.h: Guard definitions with __USE_W32_SOCKETS as
diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc
index 110fe8f16..75ca3db28 100644
--- a/winsup/cygwin/strfuncs.cc
+++ b/winsup/cygwin/strfuncs.cc
@@ -432,6 +432,7 @@ sys_cp_wcstombs (wctomb_p f_wctomb, char *charset, char *dst, size_t len,
ASCII SO; UTF-8 representation of invalid char. */
if (bytes == -1 && *charset != 'U'/*TF-8*/)
{
+ _REENT->_errno = 0;
buf[0] = 0x0e; /* ASCII SO */
bytes = __utf8_wctomb (_REENT, buf + 1, pw, charset, &ps);
if (bytes == -1)