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 <[EMAIL PROTECTED]>

        * 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 ());
     }


Reply via email to