This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
[patch] streambuf.tcc fix (i hope :)
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: [patch] streambuf.tcc fix (i hope :)
- From: brent verner <brent at rcfile dot org>
- Date: Mon, 5 Jun 2000 07:26:52 -0400
well, after about 24 hours in ddd, I've solved my mystery. I think.
in _S_copy_streambufs(...) __bufsize was being set only once. this
caused the last sputn() to write a full buffer length when only
a portion of the buffer was last read in.
the change below fixes my case, and seems sane enough to me, but then
it took me nearly three days to find it, so my sanity appraisal could
be _way_ off base :)
hoping this is sane,
brent
===========================
diff -ru libstdc++-v3/ChangeLog libstdc++-v3.hacked/ChangeLog
--- libstdc++-v3/ChangeLog Fri Jun 2 21:52:32 2000
+++ libstdc++-v3.hacked/ChangeLog Mon Jun 5 07:01:34 2000
@@ -1,3 +1,6 @@
+2000-06-05 Brent Verner <brent@hesketh.com>
+ * bits/streambuf.tcc: repaired _S_copy_streambufs()
+
2000-06-02 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* bits/locale_facets.h: Tweak.
diff -ru libstdc++-v3/bits/streambuf.tcc libstdc++-v3.hacked/bits/streambuf.tcc
--- libstdc++-v3/bits/streambuf.tcc Fri May 19 05:33:23 2000
+++ libstdc++-v3.hacked/bits/streambuf.tcc Mon Jun 5 07:18:34 2000
@@ -242,6 +242,10 @@
}
else
break;
+
+ __bufsize = __sbin->in_avail();
+ // could cheat and use _M_buf_size to save a fn call -=db=-
+ // __bufsize = __sbin->_M_buf_size;
}
}
catch(exception& __fail) {