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:
authorCorinna Vinschen <corinna@vinschen.de>2009-09-23 21:13:55 +0400
committerCorinna Vinschen <corinna@vinschen.de>2009-09-23 21:13:55 +0400
commit8e3607fceec5ab9fba7824fd080e22d024b99362 (patch)
tree83441b5e43608d04eb4c158ddcb7f71d0f77b2a3 /winsup/cygwin/strfuncs.cc
parent565d6ede3f00feb2075654e16522056a92d08e6e (diff)
* strfuncs.cc (__set_charset_from_codepage): Fetch current ANSI
codepage if cp is 0.
Diffstat (limited to 'winsup/cygwin/strfuncs.cc')
-rw-r--r--winsup/cygwin/strfuncs.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc
index d4dbdaf55..e273f76c6 100644
--- a/winsup/cygwin/strfuncs.cc
+++ b/winsup/cygwin/strfuncs.cc
@@ -307,7 +307,7 @@ __big5_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n,
}
/* Convert Windows codepage to a setlocale compatible character set code.
- Called from newlib's setlocale() with the current ANSI codepage, if the
+ Called from newlib's setlocale() with codepage set to 0, if the
charset isn't given explicitely in the POSIX compatible locale specifier.
The function also returns a pointer to the corresponding _mbtowc_r
function. Also called from fhandler_console::write_normal() if the
@@ -315,6 +315,8 @@ __big5_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n,
extern "C" mbtowc_p
__set_charset_from_codepage (UINT cp, char *charset)
{
+ if (cp == 0)
+ cp = GetACP ();
switch (cp)
{
case 437: