diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-05-13 19:00:06 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-05-13 19:00:06 +0400 |
commit | b6c6ea43f30ee958ca1f0af950af01f683f7b5c9 (patch) | |
tree | 16b5a88b3b3ae4bad7bbe8747a6873b7a9ed2c02 /winsup/cygwin/strfuncs.cc | |
parent | 136033a8528352fb63fd25534de9fc10173a2576 (diff) |
* cygheap.h (cwdstuff): Convert to class. Make posix and dir private.
(cwdstuff::get_posix): New method.
(cwdstuff::reset_posix): New method.
* dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r.
* environ.cc (environ_init): Ditto. Prefer "C" locale over current
codepage default locale.
* path.cc (chdir): Use cwdstuff::get_posix method instead of accessing
cwdstuff::posix directly.
(cwdstuff::set): Defer creating posix path to first usage.
(cwdstuff::get_posix): Create posix path if it's empty, and return it.
(cwdstuff::get): Create posix path if it's empty.
* strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C"
locale.
(sys_cp_mbstowcs): Ditto.
* syscalls.cc (gen_full_path_at): Fetch CWD posix path locked.
(setlocale): Implement here. Reset CWD posix path.
Diffstat (limited to 'winsup/cygwin/strfuncs.cc')
-rw-r--r-- | winsup/cygwin/strfuncs.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc index e0395745d..150f51ff4 100644 --- a/winsup/cygwin/strfuncs.cc +++ b/winsup/cygwin/strfuncs.cc @@ -418,6 +418,8 @@ sys_cp_wcstombs (wctomb_p f_wctomb, char *charset, char *dst, size_t len, mbstate_t ps; save_errno save; + if (f_wctomb == __ascii_wctomb) + f_wctomb = __utf8_wctomb; memset (&ps, 0, sizeof ps); if (dst == NULL) len = (size_t) -1; @@ -525,6 +527,8 @@ sys_cp_mbstowcs (mbtowc_p f_mbtowc, char *charset, wchar_t *dst, size_t dlen, mbstate_t ps; save_errno save; + if (f_mbtowc == __ascii_mbtowc) + f_mbtowc = __utf8_mbtowc; memset (&ps, 0, sizeof ps); if (dst == NULL) len = (size_t)-1; |