summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-02-08 21:33:59 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-02-08 21:33:59 +0000
commit2f27950afb0fe1ffad9a2c25dcdbf282bbe4577b (patch)
treeb75d6f6971a404ed1cd8a9dfcaf38838e5ab4b5c
parent95fc66f6cbd8464c9667cf7c9d84dd935e3b119e (diff)
downloadcygnal-2f27950afb0fe1ffad9a2c25dcdbf282bbe4577b.tar.gz
cygnal-2f27950afb0fe1ffad9a2c25dcdbf282bbe4577b.tar.bz2
cygnal-2f27950afb0fe1ffad9a2c25dcdbf282bbe4577b.zip
Now *really* check in what should have been checked in 12 hours ago.
-rw-r--r--winsup/cygwin/nlsfuncs.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/nlsfuncs.cc b/winsup/cygwin/nlsfuncs.cc
index 733367282..e535b1720 100644
--- a/winsup/cygwin/nlsfuncs.cc
+++ b/winsup/cygwin/nlsfuncs.cc
@@ -294,7 +294,8 @@ lc_mbstowcs (mbtowc_p f_mbtowc, const char *charset,
n = 1;
while (n > 0)
{
- bytes = f_mbtowc (_REENT, pwcs, t, n, charset, &state);
+ bytes = f_mbtowc (_REENT, pwcs, t, 6 /* fake, always enough */,
+ charset, &state);
if (bytes == (size_t) -1)
{
state.__count = 0;
@@ -956,6 +957,7 @@ __set_locale_from_locale_alias (const char *locale, char *new_locale)
wchar_t walias[ENCODING_LEN + 1];
#define LOCALE_ALIAS_LINE_LEN 255
char alias_buf[LOCALE_ALIAS_LINE_LEN + 1], *c;
+ wchar_t *wc;
const char *alias, *replace;
char *ret = NULL;
@@ -967,6 +969,10 @@ __set_locale_from_locale_alias (const char *locale, char *new_locale)
if (mbstowcs (wlocale, locale, ENCODING_LEN + 1) == (size_t) -1)
sys_mbstowcs (wlocale, ENCODING_LEN + 1, locale);
wlocale[ENCODING_LEN] = L'\0';
+ /* Ignore @cjknarrow modifier since it's a very personal thing between
+ Cygwin and newlib... */
+ if ((wc = wcschr (wlocale, L'@')) && !wcscmp (wc + 1, L"cjknarrow"))
+ *wc = L'\0';
while (fgets (alias_buf, LOCALE_ALIAS_LINE_LEN + 1, fp))
{
alias_buf[LOCALE_ALIAS_LINE_LEN] = '\0';
@@ -1030,7 +1036,9 @@ check_codepage (char *ret)
return ret;
}
-static void
+/* Can be called via cygwin_internal (CW_INTERNAL_SETLOCALE) for application
+ which really (think they) know what they are doing. */
+extern "C" void
internal_setlocale ()
{
/* Each setlocale from the environment potentially changes the