diff options
author | Roland McGrath <roland@gnu.org> | 2002-08-31 18:29:52 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2002-08-31 18:29:52 +0000 |
commit | 426bf3a396d0f7743decebe861b503398400233e (patch) | |
tree | 93c1780d1e425359f407efd06db85826f5314799 /locale/uselocale.c | |
parent | 26e401242cf6af557eba9641953920f2908ea47e (diff) | |
download | glibc-426bf3a396d0f7743decebe861b503398400233e.tar glibc-426bf3a396d0f7743decebe861b503398400233e.tar.gz glibc-426bf3a396d0f7743decebe861b503398400233e.tar.bz2 glibc-426bf3a396d0f7743decebe861b503398400233e.zip |
* 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.
Diffstat (limited to 'locale/uselocale.c')
-rw-r--r-- | locale/uselocale.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/locale/uselocale.c b/locale/uselocale.c index d5e53113c1..d19ae50d0b 100644 --- a/locale/uselocale.c +++ b/locale/uselocale.c @@ -28,12 +28,9 @@ locale_t __uselocale (locale_t newloc) { - if (newloc == NULL) - { - locale_t loc = __libc_tsd_get (LOCALE); - return loc == &_nl_global_locale ? LC_GLOBAL_LOCALE : loc; - } - else + locale_t oldloc = __libc_tsd_get (LOCALE); + + if (newloc != NULL) { const locale_t locobj = newloc == LC_GLOBAL_LOCALE ? &_nl_global_locale : newloc; @@ -65,6 +62,6 @@ __uselocale (locale_t newloc) #endif } - return newloc; + return oldloc == &_nl_global_locale ? LC_GLOBAL_LOCALE : oldloc; } weak_alias (__uselocale, uselocale) |