From 5e85fa99975d9e53b980e3f8f78732966769f9de Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Wed, 20 Nov 2002 21:22:48 +0000 Subject: [PATCH] streambuf.tcc (__copy_streambufs): Revert previous fix for the interactive half of libstdc++/6745... 2002-11-20 Benjamin Kosnik Jonathan Lennox * 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 From-SVN: r59314 --- libstdc++-v3/ChangeLog | 8 ++++++++ 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 34338f7ae13..d330a0e675b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2002-11-20 Benjamin Kosnik + Jonathan Lennox + + * 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 * 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 2862dff34ca..a2e0b4b1749 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 -#endif - namespace std { template @@ -224,11 +220,8 @@ namespace std } else { -#ifdef _GLIBCPP_HAVE_ISATTY - size_t __size = isatty(0) ? 1 : static_cast(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); -- 2.30.2