diff --git a/plugins/input/ogr/ogr_datasource.cpp b/plugins/input/ogr/ogr_datasource.cpp index 50fb633e3..1ab493eec 100644 --- a/plugins/input/ogr/ogr_datasource.cpp +++ b/plugins/input/ogr/ogr_datasource.cpp @@ -203,6 +203,7 @@ void ogr_datasource::bind() const unsigned num_layers = dataset_->GetLayerCount(); bool layer_found = false; + std::vector layer_names; for (unsigned i = 0; i < num_layers; ++i ) { OGRLayer* ogr_layer = dataset_->GetLayer(i); @@ -210,7 +211,7 @@ void ogr_datasource::bind() const if (ogr_layer_def != 0) { layer_found = true; - s << " '" << ogr_layer_def->GetName() << "' "; + layer_names.push_back(std::string("'") + ogr_layer_def->GetName() + std::string("'")); } } @@ -218,6 +219,10 @@ void ogr_datasource::bind() const { s << "None (no layers were found in dataset)"; } + else + { + s << boost::algorithm::join(layer_names,", "); + } throw datasource_exception(s.str()); }