This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: seek bug in stringstream?
- To: Lars Gullik Bjønnes <larsbj at lyx dot org>
- Subject: Re: seek bug in stringstream?
- From: Benjamin Kosnik <bkoz at cygnus dot com>
- Date: Thu, 23 Mar 2000 22:08:29 -0800 (PST)
- cc: libstdc++ at sourceware dot cygnus dot com
> gives:
>
> -1
> 5
> 12
this is correct. if gptr() is not valid, pos_type(-1) is returned.
> 0
> 5
> 12
> 0
> 5
> 12
... these should be -1 not 0.
> --- /home/larsbj/Development/libstdc++/bits/sstream.tcc Fri Mar 24 01:41:56 2000
> +++ /local/larsbj/egcs/libstdc++-v3/bits/sstream.tcc Fri Mar 24 04:11:01 2000
> @@ -123,8 +123,7 @@
> bool __testout = __mode & ios_base::out && _M_mode & ios_base::out;
> bool __testboth = __testin && __testout && __way != ios_base::cur;
>
> - if (((__testin && !__testout) || (__testout && !__testin) || __testboth)
> - && _M_buf_size)
> + if (((__testin && !__testout) || (__testout && !__testin) || __testboth))
> {
> char_type* __beg = _M_buf;
> char_type* __curi = NULL;
nope. This is incorrect.
I believe CVS libstdc++ is correct now.
-benjamin