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:
Diffstat (limited to 'newlib/libc/locale/newlocale.c')
-rw-r--r--newlib/libc/locale/newlocale.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/locale/newlocale.c b/newlib/libc/locale/newlocale.c
index 0789d5fd9..08f29dbcc 100644
--- a/newlib/libc/locale/newlocale.c
+++ b/newlib/libc/locale/newlocale.c
@@ -188,7 +188,8 @@ _newlocale_r (struct _reent *p, int category_mask, const char *locale,
if (tmp_locale.lc_cat[i].buf == (const void *) -1)
{
tmp_locale.lc_cat[i].buf = base->lc_cat[i].buf;
- base->lc_cat[i].ptr = base->lc_cat[i].buf = NULL;
+ if (base != __get_C_locale ())
+ base->lc_cat[i].ptr = base->lc_cat[i].buf = NULL;
}
#endif /* __HAVE_LOCALE_INFO__ */
_freelocale_r (p, base);