This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: seek bug in stringstream?


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]