Skip to content

Commit

Permalink
Created VSIError to report VSI errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
lossyrob committed Feb 26, 2016
1 parent bb986fc commit 9164eb1
Show file tree
Hide file tree
Showing 26 changed files with 1,142 additions and 628 deletions.
13 changes: 7 additions & 6 deletions gdal/apps/gdalinfo_bin.cpp
Expand Up @@ -82,7 +82,7 @@ static void GDALInfoOptionsForBinaryFree( GDALInfoOptionsForBinary* psOptionsFor
/* main() */
/************************************************************************/

int main( int argc, char ** argv )
int main( int argc, char ** argv )

{
EarlySetConfigOptions(argc, argv);
Expand Down Expand Up @@ -127,8 +127,9 @@ int main( int argc, char ** argv )
while (__AFL_LOOP(1000)) {
iIter ++;
#endif

GDALDatasetH hDataset
= GDALOpenEx( psOptionsForBinary->pszFilename, GDAL_OF_READONLY | GDAL_OF_RASTER, NULL,
= GDALOpenEx( psOptionsForBinary->pszFilename, GDAL_OF_READONLY | GDAL_OF_RASTER | GDAL_OF_VERBOSE_ERROR, NULL,
(const char* const* )psOptionsForBinary->papszOpenOptions, NULL );

if( hDataset == NULL )
Expand All @@ -143,16 +144,16 @@ int main( int argc, char ** argv )
/* -------------------------------------------------------------------- */
/* If argument is a VSIFILE, then print its contents */
/* -------------------------------------------------------------------- */
if ( STARTS_WITH(psOptionsForBinary->pszFilename, "/vsizip/") ||
STARTS_WITH(psOptionsForBinary->pszFilename, "/vsitar/") )
if ( STARTS_WITH(psOptionsForBinary->pszFilename, "/vsizip/") ||
STARTS_WITH(psOptionsForBinary->pszFilename, "/vsitar/") )
{
char** papszFileList = VSIReadDirRecursive( psOptionsForBinary->pszFilename );
if ( papszFileList )
{
int nCount = CSLCount( papszFileList );
fprintf( stdout,
fprintf( stdout,
"Unable to open source `%s' directly.\n"
"The archive contains %d files:\n",
"The archive contains %d files:\n",
psOptionsForBinary->pszFilename, nCount );
for ( int i = 0; i < nCount; i++ )
{
Expand Down

0 comments on commit 9164eb1

Please sign in to comment.