diff --git a/src/Airports/GenAirports850/main.cxx b/src/Airports/GenAirports850/main.cxx index 5421431c..7b778826 100644 --- a/src/Airports/GenAirports850/main.cxx +++ b/src/Airports/GenAirports850/main.cxx @@ -394,18 +394,20 @@ int main(int argc, char **argv) position = scheduler->FindAirport( start_id ); // add remaining airports within boundary - scheduler->AddAirports( position, min_lat, min_lon, max_lat, max_lon ); - - // parse all the airports that were found - scheduler->Schedule( num_threads, summary_file ); + if ( scheduler->AddAirports( position, min_lat, min_lon, max_lat, max_lon ) ) + { + // parse all the airports that were found + scheduler->Schedule( num_threads, summary_file ); + } } else { // find all airports within given boundary - scheduler->AddAirports( 0, min_lat, min_lon, max_lat, max_lon ); - - // and parser them - scheduler->Schedule( num_threads, summary_file ); + if ( scheduler->AddAirports( 0, min_lat, min_lon, max_lat, max_lon ) ) + { + // and parse them + scheduler->Schedule( num_threads, summary_file ); + } } SG_LOG(SG_GENERAL, SG_INFO, "Done"); diff --git a/src/Airports/GenAirports850/scheduler.cxx b/src/Airports/GenAirports850/scheduler.cxx index 12b3b93f..2dcfafad 100644 --- a/src/Airports/GenAirports850/scheduler.cxx +++ b/src/Airports/GenAirports850/scheduler.cxx @@ -590,7 +590,7 @@ void Scheduler::RetryAirport( AirportInfo* pai ) retryList.push_back( *pai ); } -void Scheduler::AddAirports( long start_pos, float min_lat, float min_lon, float max_lat, float max_lon ) +bool Scheduler::AddAirports( long start_pos, float min_lat, float min_lon, float max_lat, float max_lon ) { char line[2048]; char* def; @@ -760,6 +760,15 @@ void Scheduler::AddAirports( long start_pos, float min_lat, float min_lon, float } } } + + // did we add airports to the parse list? + if ( originalList.size() ) + { + return true; + } else + { + return false; + } } Scheduler::Scheduler(string& cmd, string& datafile, const string& root, const string_list& elev_src) diff --git a/src/Airports/GenAirports850/scheduler.hxx b/src/Airports/GenAirports850/scheduler.hxx index 27f3f8fc..ef6c8b57 100644 --- a/src/Airports/GenAirports850/scheduler.hxx +++ b/src/Airports/GenAirports850/scheduler.hxx @@ -176,7 +176,7 @@ public: long FindAirport( string icao ); void AddAirport( string icao ); - void AddAirports( long start_pos, float min_lat, float min_lon, float max_lat, float max_lon ); + bool AddAirports( long start_pos, float min_lat, float min_lon, float max_lat, float max_lon ); void RetryAirport( AirportInfo* pInfo ); void Schedule( int num_threads, string& summaryfile );