diff --git a/simgear/scene/tgdb/AreaFeatureBin.cxx b/simgear/scene/tgdb/AreaFeatureBin.cxx index e9b18b50..500b1183 100644 --- a/simgear/scene/tgdb/AreaFeatureBin.cxx +++ b/simgear/scene/tgdb/AreaFeatureBin.cxx @@ -58,6 +58,8 @@ AreaFeatureBin::AreaFeatureBin(const SGPath& absoluteFileName, const std::string std::string line; std::getline(stream, line); + if (line.length() == 0) continue; + // strip comments std::string::size_type hash_pos = line.find('#'); if (hash_pos != std::string::npos) diff --git a/simgear/scene/tgdb/CoastlineBin.cxx b/simgear/scene/tgdb/CoastlineBin.cxx index 577fc485..80ea660a 100644 --- a/simgear/scene/tgdb/CoastlineBin.cxx +++ b/simgear/scene/tgdb/CoastlineBin.cxx @@ -62,6 +62,8 @@ CoastlineBin::CoastlineBin(const SGPath& absoluteFileName) if (hash_pos != std::string::npos) line.resize(hash_pos); + if (line.length() == 0) continue; + // and process further std::stringstream in(line); diff --git a/simgear/scene/tgdb/LineFeatureBin.cxx b/simgear/scene/tgdb/LineFeatureBin.cxx index edfd361e..0164333a 100644 --- a/simgear/scene/tgdb/LineFeatureBin.cxx +++ b/simgear/scene/tgdb/LineFeatureBin.cxx @@ -58,6 +58,8 @@ LineFeatureBin::LineFeatureBin(const SGPath& absoluteFileName, const std::string std::string line; std::getline(stream, line); + if (line.length() == 0) continue; + // strip comments std::string::size_type hash_pos = line.find('#'); if (hash_pos != std::string::npos)