]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
streambuf.tcc (__copy_streambufs): Revert previous fix for the interactive half of...
authorBenjamin Kosnik <bkoz@redhat.com>
Wed, 20 Nov 2002 21:22:48 +0000 (21:22 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 20 Nov 2002 21:22:48 +0000 (21:22 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/streambuf.tcc

index 34338f7ae13bea9d77e2bd42be48517a91d66dc5..d330a0e675b52ab72946b746b72f78e3caecddb0 100644 (file)
@@ -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
index 2862dff34ca2ed0939106f35f15d75ec364c49e1..a2e0b4b1749518abeb53ca085011c05208e47c6d 100644 (file)
 
 #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);