From stdcxx-dev-return-5368-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Fri Oct 05 03:56:50 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 6067 invoked from network); 5 Oct 2007 03:56:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2007 03:56:50 -0000 Received: (qmail 95898 invoked by uid 500); 5 Oct 2007 03:56:39 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 95875 invoked by uid 500); 5 Oct 2007 03:56:39 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 95864 invoked by uid 99); 5 Oct 2007 03:56:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 20:56:39 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 72.14.204.232 as permitted sender) Received: from [72.14.204.232] (HELO qb-out-0506.google.com) (72.14.204.232) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2007 03:56:40 +0000 Received: by qb-out-0506.google.com with SMTP id z1so66982qbc for ; Thu, 04 Oct 2007 20:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=s2WmAOssltPSD4fyHTbQ0Npu+9teNJPRIccSI198cWw=; b=DRdGKxC17kagrSjl/Z6CfSi5x7n4RA2XlN/GxzoavYW89hVRqkwm3tUrwLjBmSFRvRhyqkn1bWGo82NR/6RpUKN1deb3ME6Vqg/LAhK8V07lAGdi76Qd1DT6jaIuZLMU6HuW3MI2t0zUo+T8ln7flrRRw8qsZLRSqkxkwl9zxrY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=kSTwCTDyM8HraSNYy/N/ajwWw0s4eSxz6sR8/PcwzDdiXHvB2AhGe8Jy2WE4P5riD96tOeFhT2VIILBKHxOiDypmz5W7qI8NKsRuMPTnpjyH9i692tGzZ4mSH3p5sUNEnUcJTRo3Wx2eXuJl9q6cUWbhh9e0vJsjft3hdvYYafc= Received: by 10.114.148.1 with SMTP id v1mr10444979wad.1191556578866; Thu, 04 Oct 2007 20:56:18 -0700 (PDT) Received: from ?10.19.230.97? ( [67.53.46.3]) by mx.google.com with ESMTPS id g22sm4540541rvb.2007.10.04.20.56.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Oct 2007 20:56:17 -0700 (PDT) Message-ID: <4705B5DC.2040008@roguewave.com> Date: Thu, 04 Oct 2007 17:56:12 -1000 From: Martin Sebor User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070111 SeaMonkey/1.1 MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: svn commit: r581872 - /incubator/stdcxx/trunk/include/sstream.cc References: <20071004121624.DA7921A9832@eris.apache.org> In-Reply-To: <20071004121624.DA7921A9832@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org faridz@apache.org wrote: > Author: faridz > Date: Thu Oct 4 05:16:24 2007 > New Revision: 581872 > > URL: http://svn.apache.org/viewvc?rev=581872&view=rev > Log: > 2007-10-04 Farid Zaripov > > * Merged the head of branches/4.2.0 This change has not been sufficiently tested on trunk. I don't have time to check the test results or otherwise verify that the change is okay, and won't until next week, so I'll leave it up to others to decide whether it should be reverted or if they feel comfortable with it despite the fact that it hasn't been fully tested. In the future, please allow sufficient time to test all changes on trunk before merging them to the branch. I plan to do another merge sometime late next week so it might be safest to wait until then. Martin > > 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?rev=581872&r1=581871&r2=581872&view=diff > ============================================================================== > --- incubator/stdcxx/trunk/include/sstream.cc (original) > +++ incubator/stdcxx/trunk/include/sstream.cc Thu Oct 4 05:16:24 2007 > @@ -185,6 +185,15 @@ > const _RWSTD_SIZE_T __bufsize = > __n + (this->pptr () - this->pbase ()); > > + _RWSTD_PTRDIFF_T __off = -1; > + > + if (this->pbase () <= __s && this->pptr () > __s) { > + // __s is a part of the buffer > + _RWSTD_ASSERT (this->epptr () >= __s + __n); > + // save the offset from pbase() > + __off = this->pbase () - __s; > + } > + > // preserve current pptr() since str() would seek to end > const streamsize __cur = this->pptr () - this->pbase (); > > @@ -196,6 +205,11 @@ > this->pbump (__cur - (this->pptr () - this->pbase ())); > > _RWSTD_ASSERT (__n <= this->epptr () - this->pptr ()); > + > + if (0 <= __off) { > + // correct __s after the buffer reallocation > + __s = this->pbase () + __off; > + } > } > > // copy the whole string > > >