You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2007/07/06 17:34:57 UTC
svn commit: r553931 - /incubator/stdcxx/trunk/include/sstream.cc
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 <Fa...@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 ());
}
RE: svn commit: r553931 - /incubator/stdcxx/trunk/include/sstream.cc
Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com]
> Sent: Thursday, August 09, 2007 12:51 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: svn commit: r553931 -
> /incubator/stdcxx/trunk/include/sstream.cc
>
> What is the issue number that this resolves?
I will create JIRA issue tomorrow. I started it today,
but while I implemented the test case for it, I have found
two other bugs: STDCXX-514 and STDCXX-515 :)
Farid.
Re: svn commit: r553931 - /incubator/stdcxx/trunk/include/sstream.cc
Posted by Martin Sebor <se...@roguewave.com>.
What is the issue number that this resolves?
Martin
faridz@apache.org wrote:
> 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 <Fa...@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 ());
> }
>
>