seek bug in stringstream?

Lars Gullik Bjønnes larsbj@lyx.org
Wed May 31 19:52:00 GMT 2000


Since I got not reaction to this patch last time I sent it I'll resend
it now. I am _not_ sure that this is the correct fix, but it makes
tellp/seekoff for a stringstream behave closer to seekoff for
strstream and fstream (and ftell for that matter).

Index: sstream.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/bits/sstream.tcc,v
retrieving revision 1.1
diff -u -u -p -r1.1 sstream.tcc
--- sstream.tcc 2000/04/21 20:33:28     1.1
+++ sstream.tcc 2000/06/01 02:47:45
@@ -123,7 +123,7 @@ namespace std {
       bool __testout = __mode & ios_base::out && _M_mode & ios_base::out;
       bool __testboth = __testin && __testout && __way != ios_base::cur;
 
-      if (_M_buf_size && ((__testin != __testout) || __testboth))
+      if ((__testin != __testout) || __testboth)
        {
          char_type* __beg = _M_buf;
          char_type* __curi = NULL;    


	Lgb

| Nathan Myers <ncm@cantrip.org> writes:
| 
| | I agree with your assessment.  Please send a patch.



More information about the Libstdc++ mailing list