From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26035 invoked by alias); 12 Aug 2011 14:06:15 -0000 Received: (qmail 26015 invoked by uid 22791); 12 Aug 2011 14:06:13 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Aug 2011 14:05:56 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7CE5tlp022997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 12 Aug 2011 10:05:56 -0400 Received: from hase.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7CE5rX3013106 for ; Fri, 12 Aug 2011 10:05:55 -0400 From: Andreas Schwab To: libc-hacker@sourceware.org Subject: [PATCH] Fix undefined reference to _nl_C_locobj_ptr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Yow: LBJ, LBJ, how many JOKES did you tell today??! Date: Fri, 12 Aug 2011 14:06:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2011-08/txt/msg00003.txt.bz2 2011-08-12 Andreas Schwab * intl/l10nflist.c (_nl_normalize_codeset): Fix last change. --- intl/l10nflist.c | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/intl/l10nflist.c b/intl/l10nflist.c index 82af263..b3a59e6 100644 --- a/intl/l10nflist.c +++ b/intl/l10nflist.c @@ -334,13 +334,20 @@ _nl_normalize_codeset (codeset, name_len) char *retval; char *wp; size_t cnt; + locale_t locale; + +#if NOT_IN_libc + locale = newlocale (0, "C", NULL); +#else + locale = _nl_C_locobj_ptr; +#endif for (cnt = 0; cnt < name_len; ++cnt) - if (__isalnum_l ((unsigned char) codeset[cnt], _nl_C_locobj_ptr)) + if (__isalnum_l ((unsigned char) codeset[cnt], locale)) { ++len; - if (__isalpha_l ((unsigned char) codeset[cnt], _nl_C_locobj_ptr)) + if (__isalpha_l ((unsigned char) codeset[cnt], locale)) only_digit = 0; } @@ -354,14 +361,18 @@ _nl_normalize_codeset (codeset, name_len) wp = retval; for (cnt = 0; cnt < name_len; ++cnt) - if (__isalpha_l ((unsigned char) codeset[cnt], _nl_C_locobj_ptr)) + if (__isalpha_l ((unsigned char) codeset[cnt], locale)) *wp++ = tolower ((unsigned char) codeset[cnt]); - else if (__isdigit_l ((unsigned char) codeset[cnt], _nl_C_locobj_ptr)) + else if (__isdigit_l ((unsigned char) codeset[cnt], locale)) *wp++ = codeset[cnt]; *wp = '\0'; } +#if NOT_IN_libc + freelocale (locale); +#endif + return (const char *) retval; } -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."