The behaviour of basic_stringbuf::str(const basic_string &) has changed in STLport 5.2 and is now different from previous STLport versions and other compilers like gcc and Visual C++.
Even though I agree that the new behaviour is more useful, it's different from what other commonly used C++ compilers do. This makes the new behaviour useless in portable code. I suggest reverting this change. The patch should do that unless I've missed something (the original changeset is quite large and includes other large changes).