From: corinna Date: Wed, 25 Mar 2009 13:54:41 +0000 (+0000) Subject: * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two X-Git-Tag: cgen-snapshot-20091101~3212 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f46ecdb86ae5587414a3123368b105ac7bbe2c33;p=pf3gnuchains%2Fpf3gnuchains4x.git * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two ASCII SO's. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f4ad4b02cd..ed134d8066 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2009-03-25 Corinna Vinschen + * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two + ASCII SO's. + +2009-03-25 Corinna Vinschen + * environ.cc (environ_init): Break from locale loop after first hit. * fhandler_console.cc (fhandler_console::write_normal): Print a SO sequence using always valid Unicode chars. diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc index adadc32b7a..03e14c0152 100644 --- a/winsup/cygwin/strfuncs.cc +++ b/winsup/cygwin/strfuncs.cc @@ -320,9 +320,8 @@ sys_wcstombs (char *dst, size_t len, const PWCHAR src, size_t nwc) pw &= 0xff; int bytes = _wctomb_r (_REENT, buf, pw, &ps); /* Convert chars invalid in the current codepage to a sequence - ASCII SO; UTF-8 representation of invalid char. - Do the same for ASCII SO itself. */ - if ((bytes == -1 || pw == 0x0e) && *__locale_charset () != 'U'/*TF-8*/) + ASCII SO; UTF-8 representation of invalid char. */ + if (bytes == -1 && *__locale_charset () != 'U'/*TF-8*/) { buf[0] = 0x0e; /* ASCII SO */ bytes = __utf8_wctomb (_REENT, buf + 1, pw, __locale_charset (), &ps);