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
This commit is contained in:
parent
c986baf631
commit
d9d71657bd
|
@ -1,3 +1,10 @@
|
||||||
|
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>
|
2002-11-17 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* config/linker-map.gnu: Export _S_construct even if size_t is
|
* config/linker-map.gnu: Export _S_construct even if size_t is
|
||||||
|
|
|
@ -37,6 +37,10 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
|
#ifdef _GLIBCPP_HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
template<typename _CharT, typename _Traits>
|
template<typename _CharT, typename _Traits>
|
||||||
|
@ -219,8 +223,14 @@ namespace std
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_CharT __buf[256];
|
#ifdef _GLIBCPP_HAVE_ISATTY
|
||||||
streamsize __charsread = __sbin->sgetn(__buf, sizeof(__buf));
|
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);
|
__xtrct = __sbout->sputn(__buf, __charsread);
|
||||||
__ret += __xtrct;
|
__ret += __xtrct;
|
||||||
if (__xtrct != __charsread)
|
if (__xtrct != __charsread)
|
||||||
|
|
Loading…
Reference in New Issue