- _content = new char *[_nAirports+1];
- for (int i = 0; i < _nAirports; i++) {
- const FGAirport *airport = _airports->getAirport(i);
- snprintf(buf, 1023, "%s (%s)",
- airport->getName().c_str(),
- airport->getId().c_str());
+void
+AirportList::create_list()
+{
+ char **content = FGAirport::searchNamesAndIdents(_filter);
+ int n = (content[0] != NULL) ? 1 : 0;
+
+ // work around plib 2006/04/18 bug: lists with no entries cause crash on arrow-up
+ newList(n > 0 ? content : 0);