--- gcc-3.4.3/libstdc++-v3/config/locale/generic/c_locale.h Mon Aug 16 09:03:24 2004 +++ gcc-3.4.3/libstdc++-v3/config/locale/generic/c_locale.h Mon Jan 30 09:50:48 2012 @@ -59,10 +59,14 @@ const char* __fmt, _Tv __v, const __c_locale&, int __prec) { - char* __old = std::setlocale(LC_ALL, NULL); - char* __sav = new char[std::strlen(__old) + 1]; + char* __old = std::setlocale(LC_NUMERIC, NULL); + char* __sav = NULL; + if (std::strcmp(__old, "C")) + { + __sav = new char[std::strlen(__old) + 1]; std::strcpy(__sav, __old); - std::setlocale(LC_ALL, "C"); + std::setlocale(LC_NUMERIC, "C"); + } #ifdef _GLIBCXX_USE_C99 const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); @@ -69,8 +73,12 @@ #else const int __ret = std::sprintf(__out, __fmt, __prec, __v); #endif - std::setlocale(LC_ALL, __sav); + + if (__sav) + { + std::setlocale(LC_NUMERIC, __sav); delete [] __sav; + } return __ret; } }