Skip to content
Snippets Groups Projects
Commit 1b27825f authored by paolo's avatar paolo
Browse files

2005-01-30 Paolo Carlini <pcarlini@suse.de>

	PR libstdc++/19642
	* config/locale/generic/c_locale.h (__convert_from_v): Switch only
	LC_NUMERIC, and only when actually != "C".


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94440 138bc75d-0d04-0410-961f-82ee72b054a4
parent 05876242
No related branches found
No related tags found
No related merge requests found
2005-01-30 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/19642
* config/locale/generic/c_locale.h (__convert_from_v): Switch only
LC_NUMERIC, and only when actually != "C".
2005-01-28 Paolo Carlini <pcarlini@suse.de>
* include/tr1/type_traits (is_function): Minor consistency tweaks.
......
......@@ -59,18 +59,26 @@ namespace std
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];
std::strcpy(__sav, __old);
std::setlocale(LC_ALL, "C");
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_NUMERIC, "C");
}
#ifdef _GLIBCXX_USE_C99
const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
#else
const int __ret = std::sprintf(__out, __fmt, __prec, __v);
#endif
std::setlocale(LC_ALL, __sav);
delete [] __sav;
if (__sav)
{
std::setlocale(LC_NUMERIC, __sav);
delete [] __sav;
}
return __ret;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment