diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2009-11-17 21:12:24 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2009-11-17 21:12:24 +0000 |
commit | 32e19dcfa79d2446ed03b2c2cf7d1dc7dbf906a9 (patch) | |
tree | b6b66f4b6cf0cd589b729c7778b22f2287c6725d /libc/locale | |
parent | 3aa2fca83c692488b4abc729068c183891971d3d (diff) |
Merge changes between r9240 and r9280 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@9281 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/locale')
-rw-r--r-- | libc/locale/Makefile | 6 | ||||
-rw-r--r-- | libc/locale/duplocale.c | 6 | ||||
-rw-r--r-- | libc/locale/langinfo.h | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/libc/locale/Makefile b/libc/locale/Makefile index 5af71e597..f0e657dec 100644 --- a/libc/locale/Makefile +++ b/libc/locale/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991,1992,1995-2003,2005 Free Software Foundation, Inc. +# Copyright (C) 1991,1992,1995-2003,2005,2009 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -48,7 +48,7 @@ routines-$(OPTION_EGLIBC_LOCALE_CODE) \ ifneq (y,$(OPTION_EGLIBC_LOCALE_CODE)) routines-y += dummy-setlocale endif -tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-C-locale +tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-C-locale tst-locname tst-duplocale categories = ctype messages monetary numeric time paper name \ address telephone measurement identification collate # C-messages belongs in an intl option group. @@ -123,7 +123,7 @@ endif # This makes sure -DNOT_IN_libc is passed for all these modules. cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \ - $(locale-modules) $(lib-modules)) + $(locale-modules) $(lib-modules)) lib := nonlib include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) diff --git a/libc/locale/duplocale.c b/libc/locale/duplocale.c index 61782590d..63513c539 100644 --- a/libc/locale/duplocale.c +++ b/libc/locale/duplocale.c @@ -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; diff --git a/libc/locale/langinfo.h b/libc/locale/langinfo.h index c940c743a..0a5336507 100644 --- a/libc/locale/langinfo.h +++ b/libc/locale/langinfo.h @@ -568,7 +568,8 @@ enum /* This macro produces an item you can pass to `nl_langinfo' or `nl_langinfo_l' to get the name of the locale in use for CATEGORY. */ -#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), -1) +#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), \ + _NL_ITEM_INDEX (-1)) #ifdef __USE_GNU # define NL_LOCALE_NAME(category) _NL_LOCALE_NAME (category) #endif |