2003-10-16 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Oct 2003 17:53:49 +0000 (17:53 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Oct 2003 17:53:49 +0000 (17:53 +0000)
* src/locale.cc (locale::locale(const char*)): Tweak
a couple of comparisons to use basic_string operators.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72554 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/src/locale.cc

index c53f885..7b0f83f 100644 (file)
@@ -1,5 +1,10 @@
 2003-10-16  Paolo Carlini  <pcarlini@suse.de>
 
+       * src/locale.cc (locale::locale(const char*)): Tweak
+       a couple of comparisons to use basic_string operators.
+
+2003-10-16  Paolo Carlini  <pcarlini@suse.de>
+
        PR libstdc++/12540
        * config/locale/gnu/monetary_members.cc
        (moneypunct<wchar_t, true/false>::_M_initialize_moneypunct):
index 12f77e1..c652540 100644 (file)
@@ -221,21 +221,21 @@ namespace std
                // Scan the categories looking for the first one
                // different from LANG.
                size_t __i = 0;
-               if (std::strcmp(__res.c_str(), "C") == 0)
+               if (__res == "C")
                  for (; __i < _S_categories_size; ++__i)
                    {
                      __env = std::getenv(_S_categories[__i]);
                      if (__env && std::strcmp(__env, "") != 0 
                          && std::strcmp(__env, "C") != 0 
-                         && std::strcmp(__env, "POSIX") != 0) 
+                         && std::strcmp(__env, "POSIX") != 0)
                        break;
                    }
                else
                  for (; __i < _S_categories_size; ++__i)
                    {
                      __env = std::getenv(_S_categories[__i]);
-                     if (__env && std::strcmp(__env, "") != 0 
-                         && std::strcmp(__env, __res.c_str()) != 0) 
+                     if (__env && std::strcmp(__env, "") != 0
+                         && __res != __env)
                        break;
                    }