From 71c793f9b17ce6464e47338070893b00352849bf Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 10 Dec 2004 17:58:18 +0000 Subject: [PATCH] Handle Robin Peel's apt database with dos or unix line endings. --- src/Airports/GenAirports/main.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Airports/GenAirports/main.cxx b/src/Airports/GenAirports/main.cxx index 5e4c20ff..24e7e0a0 100644 --- a/src/Airports/GenAirports/main.cxx +++ b/src/Airports/GenAirports/main.cxx @@ -254,12 +254,14 @@ int main( int argc, char **argv ) { SG_LOG( SG_GENERAL, SG_DEBUG, "-> '" << line << "'" ); if ( line.length() ) { token = simgear::strutils::split( line ); - SG_LOG( SG_GENERAL, SG_DEBUG, "token[0] " << token[0] ); + if ( token.size() ) { + SG_LOG( SG_GENERAL, SG_DEBUG, "token[0] " << token[0] ); + } } else { token.clear(); } - if ( !line.length() ) { + if ( !line.length() || !token.size() ) { // empty line, skip } else if ( (token[0] == "#") || (token[0] == "//") ) { // comment, skip