stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r388008 - /incubator/stdcxx/trunk/etc/config/src/LOCALE_NAME_FMAT.cpp
Date Thu, 23 Mar 2006 02:50:51 GMT
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  <sebor@roguewave.com>

	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)



Mime
View raw message