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--newlib/ChangeLog5
-rw-r--r--newlib/libc/locale/nl_langinfo.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 8714a397d..43563837d 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/locale/nl_langinfo.c (nl_langinfo): Just return current locale
+ charset on Cygwin.
+
2009-10-03 Corinna Vinschen <corinna@vinschen.de>
* libc/stdlib/mbtowc_r.c (__utf8_mbtowc): Allow CESU-8 surrogate
diff --git a/newlib/libc/locale/nl_langinfo.c b/newlib/libc/locale/nl_langinfo.c
index b2923bd65..8e60c6b21 100644
--- a/newlib/libc/locale/nl_langinfo.c
+++ b/newlib/libc/locale/nl_langinfo.c
@@ -37,10 +37,14 @@
#include "lmonetary.h"
#include "lmessages.h"
+#ifndef __CYGWIN__
#define TRANSITION_PERIOD_HACK
+#endif
#define _REL(BASE) ((int)item-BASE)
+extern char *__locale_charset ();
+
char *
_DEFUN(nl_langinfo, (item),
nl_item item) {
@@ -54,6 +58,9 @@ _DEFUN(nl_langinfo, (item),
switch (item) {
case CODESET:
+#ifdef __CYGWIN__
+ ret = __locale_charset ();
+#else
ret = "";
if ((s = setlocale(LC_CTYPE, NULL)) != NULL) {
if ((cs = strchr(s, '.')) != NULL) {
@@ -92,6 +99,7 @@ _DEFUN(nl_langinfo, (item),
)
ret = "US-ASCII";
}
+#endif /* __CYGWIN__ */
break;
case D_T_FMT:
ret = (char *) __get_current_time_locale()->c_fmt;