Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 77388 invoked from network); 23 Mar 2006 02:51:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Mar 2006 02:51:13 -0000 Received: (qmail 88469 invoked by uid 500); 23 Mar 2006 02:51:13 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 88451 invoked by uid 500); 23 Mar 2006 02:51:12 -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 88440 invoked by uid 99); 23 Mar 2006 02:51:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Mar 2006 18:51:12 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 22 Mar 2006 18:51:12 -0800 Received: (qmail 77317 invoked by uid 65534); 23 Mar 2006 02:50:51 -0000 Message-ID: <20060323025051.77316.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r388008 - /incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp Date: Thu, 23 Mar 2006 02:50:51 -0000 To: stdcxx-commits@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sebor Date: Wed Mar 22 18:50:49 2006 New Revision: 388008 URL: http://svn.apache.org/viewcvs?rev=388008&view=rev Log: 2006-03-22 Martin Sebor STDCXX-140 * LOCALE_NAME_FMAT.cpp (lc_vars): Added LC_ALL. (print_lc_constants): Avoided the assumption that the name of each constant contains the equals sign. (print_categories): Iterated through all lc_vars but the element that refers to LC_ALL. 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/viewcvs/incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp?rev=388008&r1=388007&r2=388008&view=diff ============================================================================== --- incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp (original) +++ incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp Wed Mar 22 18:50:49 2006 @@ -258,6 +258,7 @@ { -1, LC_MEASUREMENT, "LC_MEASUREMENT=C", "measurement" }, #endif + { -1, LC_ALL, "LC_ALL", 0 }, { -1, 0, "", 0 } }; @@ -321,7 +322,8 @@ for (unsigned i = 0; *lc_vars [i].name; ++i) { eq = rw_strchr (lc_vars [i].name, '='); - *eq = '\0'; + if (eq) + *eq = '\0'; printf ("#define _RWSTD_%-20s %2d\n", lc_vars [i].name, lc_vars [i].cat); @@ -332,24 +334,29 @@ if (lc_vars [i].cat < lc_vars [lc_min_inx].cat) lc_min_inx = i; - *eq = '='; + if (eq) + *eq = '='; } eq = rw_strchr (lc_vars [lc_max_inx].name, '='); - *eq = '\0'; + if (eq) + *eq = '\0'; printf ("#define %-27s _RWSTD_%s\n", "_RWSTD_LC_MAX", lc_vars [lc_max_inx].name); - *eq = '='; + if (eq) + *eq = '='; eq = rw_strchr (lc_vars [lc_min_inx].name, '='); - *eq = '\0'; + if (eq) + *eq = '\0'; printf ("#define %-27s _RWSTD_%s\n", "_RWSTD_LC_MIN", lc_vars [lc_min_inx].name); - *eq = '='; + if (eq) + *eq = '='; return 0; } @@ -374,10 +381,10 @@ unsigned i; // set up the default environment (i.e., LC_COLLATE=C; LC_CTYPE=C; etc.) - for (i = 0; *lc_vars [i].name; ++i) + for (i = 0; lc_vars [i].cat != LC_ALL; ++i) putenv (lc_vars [i].name); - for (i = 0; locname && *lc_vars [i].name; ++i) { + for (i = 0; locname && lc_vars [i].cat != LC_ALL; ++i) { if (i) { if (setlocale_environ) { // replace previous LC_XXX environment variable @@ -437,9 +444,6 @@ s = rw_strchr (s, loc_name_cat_eq) + 1; lc_vars [i].ord = j; -// printf ("#define _RWSTD_CAT_%d(pfx) " -// "{ %d, \"%s\", pfx::_C_%s }\n", -// j, lc_vars [i].cat, lc_vars [i].name, lc_vars [i].lower); // look for a separator between LC_XXX=name pairs // (typically ';') @@ -484,7 +488,7 @@ loc_name_prepend_sep = 1; } - for (i = 0; *lc_vars [i].name; ++i) { + for (i = 0; lc_vars [i].cat != LC_ALL; ++i) { char* eq = rw_strchr (lc_vars [i].name, '='); if (eq)