]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Handle LC_GLOBAL_LOCALE in duplocale.
authorUlrich Drepper <drepper@redhat.com>
Tue, 17 Nov 2009 17:37:31 +0000 (09:37 -0800)
committerUlrich Drepper <drepper@redhat.com>
Tue, 17 Nov 2009 17:37:31 +0000 (09:37 -0800)
ChangeLog
locale/Makefile
locale/duplocale.c

index 8dfb46e98cd84da988a6f085ddb66bad87b74571..b92fd42c9dd6b362a69434d343c55d0fbc2e62a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
 
+       [BZ #10969]
+       * locale/duplocale.c (__duplocale): Handle LC_GLOBAL_LOCALE special.
+       * locale/tst-duplocale.c: New file.
+       * locale/Makefile (tests): Add tst-duplocale.
+
        [BZ #10968]
        * locale/langinfo.h (_NL_LOCALE_NAME): Correct definition.
        Patch by Bruno Haible <bruno@clisp.org>.
index 2d645daa2f3671377755ef5faa8edce5e7494395..2dbd8dc6a5b88b4b13a2a871735a1ff2f5218bb6 100644 (file)
@@ -38,7 +38,7 @@ distribute    = localeinfo.h categories.def iso-639.def iso-3166.def \
 routines       = setlocale findlocale loadlocale loadarchive \
                  localeconv nl_langinfo nl_langinfo_l mb_cur_max \
                  newlocale duplocale freelocale uselocale
-tests          = tst-C-locale tst-locname
+tests          = tst-C-locale tst-locname tst-duplocale
 categories     = ctype messages monetary numeric time paper name \
                  address telephone measurement identification collate
 aux            = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
index 61782590d70f4432c548e49ef4e0295610ca088c..63513c539c1e5c55a3e52935c15de8a2a16feb7b 100644 (file)
@@ -1,5 +1,5 @@
 /* Duplicate handle for selection of locales.
-   Copyright (C) 1997,2000,2001,2002,2005,2008 Free Software Foundation, Inc.
+   Copyright (C) 1997,2000-2002,2005,2008,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -37,6 +37,10 @@ __duplocale (__locale_t dataset)
   if (dataset == _nl_C_locobj_ptr)
     return dataset;
 
+  /* Handle a special value.  */
+  if (dataset == LC_GLOBAL_LOCALE)
+    dataset = &_nl_global_locale;
+
   __locale_t result;
   int cnt;
   size_t names_len = 0;