Skip to content

Commit

Permalink
ogrinfo: avoid emitting an error message twice (fixes #9459)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Mar 14, 2024
1 parent 543cd3f commit 0bb2c1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/ogrinfo_bin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ MAIN_START(argc, argv)
else if (psOptionsForBinary->osSQLStatement.empty())
{
nFlags |= GDAL_OF_READONLY;
// GDALIdentifyDriverEx() might emit an error message, e.g.
// when opening "/vsizip/foo.zip/" and the zip has more than one
// file. Cf https://github.com/OSGeo/gdal/issues/9459
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
if (GDALIdentifyDriverEx(
psOptionsForBinary->osFilename.c_str(), GDAL_OF_VECTOR,
psOptionsForBinary->aosAllowInputDrivers.List(), nullptr))
Expand Down

0 comments on commit 0bb2c1d

Please sign in to comment.