basic_string.tcc (assign(const _CharT*, size_type)): When working in place remember to set the state to sharable (otherwise...

2004-02-08  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/basic_string.tcc (assign(const _CharT*, size_type)):
	When working in place remember to set the state to sharable
	(otherwise, _M_mutate does it).

From-SVN: r77487
This commit is contained in:
Paolo Carlini 2004-02-08 17:11:07 +00:00 committed by Paolo Carlini
parent c79751b99d
commit fd95f498f3
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2004-02-08 Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.tcc (assign(const _CharT*, size_type)):
When working in place remember to set the state to sharable
(otherwise, _M_mutate does it).
2004-02-08 Bernardo Innocenti <bernie@develer.com> 2004-02-08 Bernardo Innocenti <bernie@develer.com>
* include/bits/allocator.h, include/bits/basic_ios.h, * include/bits/allocator.h, include/bits/basic_ios.h,

View File

@ -273,6 +273,7 @@ namespace std
traits_type::copy(_M_data(), __s, __n); traits_type::copy(_M_data(), __s, __n);
else if (__pos) else if (__pos)
traits_type::move(_M_data(), __s, __n); traits_type::move(_M_data(), __s, __n);
_M_rep()->_M_set_sharable();
_M_rep()->_M_length = __n; _M_rep()->_M_length = __n;
_M_data()[__n] = _Rep::_S_terminal; // grr. _M_data()[__n] = _Rep::_S_terminal; // grr.
return *this; return *this;