+2002-11-18 Paolo Carlini <pcarlini@unitus.it>
+
+ PR libstdc++/6745 (continued)
+ * include/bits/streambuf.tcc (__copy_streambufs):
+ Deal with interactive input by using isatty as in the
+ fix for libstdc++/8399.
+
2002-11-17 Jakub Jelinek <jakub@redhat.com>
* config/linker-map.gnu: Export _S_construct even if size_t is
#pragma GCC system_header
+#ifdef _GLIBCPP_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
namespace std
{
template<typename _CharT, typename _Traits>
}
else
{
- _CharT __buf[256];
- streamsize __charsread = __sbin->sgetn(__buf, sizeof(__buf));
+#ifdef _GLIBCPP_HAVE_ISATTY
+ size_t __size = isatty(0) ? 1 : static_cast<size_t>(BUFSIZ);
+#else
+ size_t __size = 1;
+#endif
+ _CharT* __buf =
+ static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __size));
+ streamsize __charsread = __sbin->sgetn(__buf, __size);
__xtrct = __sbout->sputn(__buf, __charsread);
__ret += __xtrct;
if (__xtrct != __charsread)