From: Paolo Carlini Date: Thu, 16 Oct 2003 17:53:49 +0000 (+0000) Subject: locale.cc (locale::locale(const char*)): Tweak a couple of comparisons to use basic_s... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eaed902bf7f8d086c3bc6017d52cb103057e34aa;p=gcc.git locale.cc (locale::locale(const char*)): Tweak a couple of comparisons to use basic_string operators. 2003-10-16 Paolo Carlini * src/locale.cc (locale::locale(const char*)): Tweak a couple of comparisons to use basic_string operators. From-SVN: r72554 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c53f88538f6..7b0f83f0304 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2003-10-16 Paolo Carlini + + * src/locale.cc (locale::locale(const char*)): Tweak + a couple of comparisons to use basic_string operators. + 2003-10-16 Paolo Carlini PR libstdc++/12540 diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index 12f77e1997e..c6525405211 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -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; }