diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2002-11-20 21:22:48 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2002-11-20 21:22:48 +0000 |
commit | 5e85fa99975d9e53b980e3f8f78732966769f9de (patch) | |
tree | 7eb90abab5f96541a5c9d68b645072f38b70401b | |
parent | c6de9c29fd7f0704038a889fcfec2bd013fee7ba (diff) | |
download | gcc-5e85fa99975d9e53b980e3f8f78732966769f9de.zip gcc-5e85fa99975d9e53b980e3f8f78732966769f9de.tar.gz gcc-5e85fa99975d9e53b980e3f8f78732966769f9de.tar.bz2 |
streambuf.tcc (__copy_streambufs): Revert previous fix for the interactive half of libstdc++/6745...
2002-11-20 Benjamin Kosnik <bkoz@redhat.com>
Jonathan Lennox <lennox@cs.columbia.edu>
* include/bits/streambuf.tcc (__copy_streambufs):
Revert previous fix for the interactive half of
libstdc++/6745, use _M_buf_size_opt to set dynamically
the correct buffer size.
Co-Authored-By: Jonathan Lennox <lennox@cs.columbia.edu>
From-SVN: r59314
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/streambuf.tcc | 11 |
2 files changed, 10 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 34338f7..d330a0e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2002-11-20 Benjamin Kosnik <bkoz@redhat.com> + Jonathan Lennox <lennox@cs.columbia.edu> + + * include/bits/streambuf.tcc (__copy_streambufs): + Revert previous fix for the interactive half of + libstdc++/6745, use _M_buf_size_opt to set dynamically + the correct buffer size. + 2002-11-20 Jonathan Wakely <redi@gcc.gnu.org> * docs/html/21_strings/howto.html: Fix example code, cite Gaby's diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc index 2862dff..a2e0b4b 100644 --- a/libstdc++-v3/include/bits/streambuf.tcc +++ b/libstdc++-v3/include/bits/streambuf.tcc @@ -37,10 +37,6 @@ #pragma GCC system_header -#ifdef _GLIBCPP_HAVE_UNISTD_H -#include <unistd.h> -#endif - namespace std { template<typename _CharT, typename _Traits> @@ -224,11 +220,8 @@ namespace std } else { -#ifdef _GLIBCPP_HAVE_ISATTY - size_t __size = isatty(0) ? 1 : static_cast<size_t>(BUFSIZ); -#else - size_t __size = 1; -#endif + size_t __size = + __sbin->_M_buf_size_opt > 0 ? __sbin->_M_buf_size_opt : 1; _CharT* __buf = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __size)); streamsize __charsread = __sbin->sgetn(__buf, __size); |