Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 18593 invoked from network); 5 Jun 2006 20:28:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jun 2006 20:28:11 -0000 Received: (qmail 49423 invoked by uid 500); 5 Jun 2006 20:27:49 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 49021 invoked by uid 500); 5 Jun 2006 20:27:47 -0000 Mailing-List: contact stdcxx-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-commits@incubator.apache.org Received: (qmail 48836 invoked by uid 99); 5 Jun 2006 20:27:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 13:27:44 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 13:09:42 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 39B801A983A; Mon, 5 Jun 2006 13:09:22 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r411903 - /incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp Date: Mon, 05 Jun 2006 20:09:21 -0000 To: stdcxx-commits@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060605200922.39B801A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sebor Date: Mon Jun 5 13:09:21 2006 New Revision: 411903 URL: http://svn.apache.org/viewvc?rev=411903&view=rev Log: 2006-06-05 Martin Sebor STDCXX-189 * LOCALE_NAME_FMAT.cpp (MAX_LOCALE_NAME_LEN): New macro defined to the maximum length of a locale name sufficiently large to handle excessively long names generated by GNU glibc. (main): Used it consistently throughout. Modified: incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp Modified: incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp?rev=411903&r1=411902&r2=411903&view=diff ============================================================================== --- incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp (original) +++ incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp Mon Jun 5 13:09:21 2006 @@ -19,6 +19,13 @@ #undef strcat +// the longest combined locale name handled by the test (GNU glibc +// can generate some awfully long names since in addition to the +// name of the locale name for each category it includes the name +// of the category itself, e.g., "LC_CTYPE=en;LC_NUMERIC=es;...") +#define MAX_LOCALE_NAME_LEN 1024 + + #if 0 // disabled // enable for debugging to emulate a system with no locales installed @@ -126,7 +133,7 @@ char loc_name_cat_sep = '\0'; char loc_name_cat_eq = '\0'; - char namebuf [1024]; + char namebuf [MAX_LOCALE_NAME_LEN]; namebuf [0] = '\0'; // determine whether setlocale(LC_ALL, name) returns @@ -181,14 +188,14 @@ // determine if the environment has any effect on setlocale() { - char def_locale [256]; + char def_locale [MAX_LOCALE_NAME_LEN]; def_locale [0] = '\0'; const char *tmpname = setlocale (LC_ALL, ""); if (tmpname) strcpy (def_locale, tmpname); - char buf [256]; + char buf [MAX_LOCALE_NAME_LEN]; strcpy (buf, "LC_COLLATE="); strcat (buf, locname); putenv (buf);