Commit d9d71657 by Paolo Carlini Committed by Paolo Carlini

PR libstdc++/6745 (continued)

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.

From-SVN: r59229
parent c986baf6
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
......
......@@ -37,6 +37,10 @@
#pragma GCC system_header
#ifdef _GLIBCPP_HAVE_UNISTD_H
#include <unistd.h>
#endif
namespace std
{
template<typename _CharT, typename _Traits>
......@@ -219,8 +223,14 @@ namespace std
}
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment