Author: sebor
Date: Fri Feb 2 15:38:18 2007
New Revision: 502791
URL: http://svn.apache.org/viewvc?view=rev&rev=502791
Log:
i2007-02-02 Martin Sebor <[EMAIL PROTECTED]>
STDCXX-295
* sstream.cc (seekoff): Prevented the function from failing when
offset is 0 and neither sequence has been initialized yet (see
LWG issue 453:
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#453).
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=502791&r1=502790&r2=502791
==============================================================================
--- incubator/stdcxx/trunk/include/sstream.cc (original)
+++ incubator/stdcxx/trunk/include/sstream.cc Fri Feb 2 15:38:18 2007
@@ -390,7 +390,9 @@
if (__which & ios_base::in) {
- if (!this->_C_is_in () || !this->gptr ())
+ // LWG issue 453: the operation fails if either gptr() or pptr()
+ // is a null pointer and the new offset newoff is nonzero
+ if (!this->_C_is_in () || __off && !this->gptr ())
return pos_type (off_type (-1));
// do the checks for in|out mode here
@@ -414,11 +416,13 @@
if (__which & ios_base::out) {
- if (!this->_C_is_out () || !this->pptr ())
+ // LWG issue 453: the operation fails if either gptr() or pptr()
+ // is a null pointer and the new offset newoff is nonzero
+ if (!this->_C_is_out () || __off && !this->pptr ())
return pos_type (off_type (-1));
// egptr() is used as the "high mark" even when not in "in" mode
- _RWSTD_ASSERT (0 != this->egptr ());
+ _RWSTD_ASSERT (0 == this->pbase () || 0 != this->egptr ());
// compute the number of initialized characters in the buffer
// (see LWG issue 432)