1
0
Fork 0

Handle Robin Peel's apt database with dos or unix line endings.

This commit is contained in:
curt 2004-12-10 17:58:18 +00:00
parent fd8f816ee1
commit 71c793f9b1

View file

@ -254,12 +254,14 @@ int main( int argc, char **argv ) {
SG_LOG( SG_GENERAL, SG_DEBUG, "-> '" << line << "'" ); SG_LOG( SG_GENERAL, SG_DEBUG, "-> '" << line << "'" );
if ( line.length() ) { if ( line.length() ) {
token = simgear::strutils::split( line ); 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 { } else {
token.clear(); token.clear();
} }
if ( !line.length() ) { if ( !line.length() || !token.size() ) {
// empty line, skip // empty line, skip
} else if ( (token[0] == "#") || (token[0] == "//") ) { } else if ( (token[0] == "#") || (token[0] == "//") ) {
// comment, skip // comment, skip