stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r553931 - /incubator/stdcxx/trunk/include/sstream.cc
Date Fri, 06 Jul 2007 15:34:57 GMT
Author: faridz
Date: Fri Jul  6 08:34:56 2007
New Revision: 553931

URL: http://svn.apache.org/viewvc?view=rev&rev=553931
Log:
2007-07-06 Farid Zaripov <Farid_Zaripov@epam.com>

	* sstream.cc (xsputn): Allow to pass internal buffer as method parameter.

Modified:
    incubator/stdcxx/trunk/include/sstream.cc

Modified: incubator/stdcxx/trunk/include/sstream.cc
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/sstream.cc?view=diff&rev=553931&r1=553930&r2=553931
==============================================================================
--- incubator/stdcxx/trunk/include/sstream.cc (original)
+++ incubator/stdcxx/trunk/include/sstream.cc Fri Jul  6 08:34:56 2007
@@ -185,9 +185,20 @@
         const _RWSTD_SIZE_T __bufsize =
             __n + (this->pptr () - this->pbase ());
 
+        int off = -1;
+
+        if (this->pbase () <= __s && this->pptr () > __s) {
+            // __s is part of buffer
+            _RWSTD_ASSERT (this->epptr () >= __s + __n);
+            off = this->pbase () - __s;
+        }
+
         // grow the buffer if necessary to accommodate the whole
         // string plus the contents of the buffer up to pptr()
         str (this->_C_buffer, __bufsize);
+
+        if (0 <= off)
+            __s = this->pbase () + off;
 
         _RWSTD_ASSERT (__n <= this->epptr () - this->pptr ());
     }



Mime
View raw message