From c9732d7643b30e4414ce5e759019365e08a0ce10 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sat, 22 Mar 2008 20:17:31 +0100 Subject: fix for problems with old compilers --- tools.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'tools.cpp') diff --git a/tools.cpp b/tools.cpp index 3a80ff7..cca1b9d 100644 --- a/tools.cpp +++ b/tools.cpp @@ -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 { -- cgit v1.2.3