summaryrefslogtreecommitdiff
path: root/tools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools.cpp')
-rw-r--r--tools.cpp21
1 files changed, 11 insertions, 10 deletions
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 {