ostream.tcc (operator<<(basic_ostream<>&, const char*)): Further fix for throwing widen.

2006-10-14  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/ostream.tcc (operator<<(basic_ostream<>&,
	const char*)): Further fix for throwing widen.

From-SVN: r117730
This commit is contained in:
Paolo Carlini 2006-10-14 10:25:35 +00:00 committed by Paolo Carlini
parent 78a438f161
commit 4fb1953207
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2006-10-14 Paolo Carlini <pcarlini@suse.de>
* include/bits/ostream.tcc (operator<<(basic_ostream<>&,
const char*)): Further fix for throwing widen.
2006-10-14 Paolo Carlini <pcarlini@suse.de>
* include/bits/ostream.tcc (operator<<(basic_ostream<>&,

View File

@ -325,17 +325,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const size_t __clen = char_traits<char>::length(__s);
_CharT* __ws = 0;
try
{ __ws = new _CharT[__clen]; }
{
__ws = new _CharT[__clen];
for (size_t __i = 0; __i < __clen; ++__i)
__ws[__i] = __out.widen(__s[__i]);
}
catch(...)
{
delete [] __ws;
__out._M_setstate(ios_base::badbit);
return __out;
}
try
{
for (size_t __i = 0; __i < __clen; ++__i)
__ws[__i] = __out.widen(__s[__i]);
__out._M_insert(__ws, __clen);
delete [] __ws;
}