diff options
-rw-r--r-- | tools.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -17,16 +17,17 @@ using namespace tnt; istream& operator>>( istream& is, tChannelID& ret ) { - string line; - if ( !getline( is, line ) ) { - if ( !is.eof() ) - is.setstate( ios::badbit ); - return is; - } - - if ( !line.empty() && !( ret = tChannelID::FromString( line.c_str() ) ).Valid() ) - is.setstate( ios::badbit ); - return is; + string line; + if ( !getline( is, line ) ) { + if ( !is.eof() ) + is.setstate( ios::badbit ); + else + is.clear(); + return is; + } + if ( !line.empty() && !( ret = tChannelID::FromString( line.c_str() ) ).Valid() ) + is.setstate( ios::badbit ); + return is; } namespace vdrlive { |