diff options
Diffstat (limited to 'libstdc++-v3/src/fstream.cc')
-rw-r--r-- | libstdc++-v3/src/fstream.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libstdc++-v3/src/fstream.cc b/libstdc++-v3/src/fstream.cc index be711339b72..544f6a4741f 100644 --- a/libstdc++-v3/src/fstream.cc +++ b/libstdc++-v3/src/fstream.cc @@ -1,6 +1,6 @@ // File based streams -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -50,10 +50,14 @@ namespace std // normal buffers and jet outta here before expensive // fileops happen... if (_M_pback_init) + _M_pback_destroy(); + + if (_M_in_cur && _M_in_cur < _M_in_end) { - _M_pback_destroy(); - if (_M_in_cur < _M_in_end) - return traits_type::to_int_type(*_M_in_cur); + __ret = traits_type::to_int_type(*_M_in_cur); + if (__bump) + _M_in_cur_move(1); + return __ret; } // Sync internal and external buffers. @@ -115,10 +119,14 @@ namespace std // normal buffers and jet outta here before expensive // fileops happen... if (_M_pback_init) + _M_pback_destroy(); + + if (_M_in_cur && _M_in_cur < _M_in_end) { - _M_pback_destroy(); - if (_M_in_cur < _M_in_end) - return traits_type::to_int_type(*_M_in_cur); + __ret = traits_type::to_int_type(*_M_in_cur); + if (__bump) + _M_in_cur_move(1); + return __ret; } // Sync internal and external buffers. |