mirror of git://sourceware.org/git/glibc.git
* locale/duplocale.c (__duplocale): Free names from the right array.
* locale/uselocale.c (__uselocale): Return previous locale when setting a new one. * locale/newlocale.c: Commit changes from 2002-08-30 batch where I failed to commit this file: (__newlocale): Fill in __names array.
This commit is contained in:
parent
26e401242c
commit
426bf3a396
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2002-08-31 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* locale/duplocale.c (__duplocale): Free names from the right array.
|
||||||
|
|
||||||
|
* locale/uselocale.c (__uselocale): Return previous locale when
|
||||||
|
setting a new one.
|
||||||
|
|
||||||
|
* locale/newlocale.c: Commit changes from 2002-08-30
|
||||||
|
batch where I failed to commit this file:
|
||||||
|
(__newlocale): Fill in __names array.
|
||||||
|
|
||||||
2002-08-31 Ulrich Drepper <drepper@redhat.com>
|
2002-08-31 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* sysdeps/gnu/Makefile: Only depend on Versions.v.i for
|
* sysdeps/gnu/Makefile: Only depend on Versions.v.i for
|
||||||
|
|
|
@ -56,8 +56,8 @@ __duplocale (__locale_t dataset)
|
||||||
if (result->__names[cnt] == NULL)
|
if (result->__names[cnt] == NULL)
|
||||||
{
|
{
|
||||||
while (cnt-- > 0)
|
while (cnt-- > 0)
|
||||||
if (dataset->__names[cnt] != _nl_C_name)
|
if (result->__names[cnt] != _nl_C_name)
|
||||||
free ((char *) dataset->__names[cnt]);
|
free ((char *) result->__names[cnt]);
|
||||||
free (result);
|
free (result);
|
||||||
result = NULL;
|
result = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -28,12 +28,9 @@
|
||||||
locale_t
|
locale_t
|
||||||
__uselocale (locale_t newloc)
|
__uselocale (locale_t newloc)
|
||||||
{
|
{
|
||||||
if (newloc == NULL)
|
locale_t oldloc = __libc_tsd_get (LOCALE);
|
||||||
{
|
|
||||||
locale_t loc = __libc_tsd_get (LOCALE);
|
if (newloc != NULL)
|
||||||
return loc == &_nl_global_locale ? LC_GLOBAL_LOCALE : loc;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
const locale_t locobj
|
const locale_t locobj
|
||||||
= newloc == LC_GLOBAL_LOCALE ? &_nl_global_locale : newloc;
|
= newloc == LC_GLOBAL_LOCALE ? &_nl_global_locale : newloc;
|
||||||
|
@ -65,6 +62,6 @@ __uselocale (locale_t newloc)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return newloc;
|
return oldloc == &_nl_global_locale ? LC_GLOBAL_LOCALE : oldloc;
|
||||||
}
|
}
|
||||||
weak_alias (__uselocale, uselocale)
|
weak_alias (__uselocale, uselocale)
|
||||||
|
|
Loading…
Reference in New Issue