Changeset 13993
- Timestamp:
- 03/13/08 10:51:46 (2 months ago)
- Files:
-
- trunk/gdal/frmts/raw/ndfdataset.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/frmts/raw/ndfdataset.cpp
r11465 r13993 247 247 { 248 248 char szKey[100]; 249 const char *pszFilename;249 CPLString osFilename; 250 250 251 251 sprintf( szKey, "BAND%d_FILENAME", iBand+1 ); 252 pszFilename = poDS->Get(szKey,NULL);252 osFilename = poDS->Get(szKey,""); 253 253 254 254 // NDF1 file do not include the band filenames. 255 if( pszFilename == NULL)255 if( osFilename.size() == 0 ) 256 256 { 257 257 char szBandExtension[15]; 258 258 sprintf( szBandExtension, "I%d", iBand+1 ); 259 pszFilename = CPLResetExtension( poOpenInfo->pszFilename,260 szBandExtension );259 osFilename = CPLResetExtension( poOpenInfo->pszFilename, 260 szBandExtension ); 261 261 } 262 263 FILE *fpRaw = VSIFOpenL( pszFilename, "rb" ); 262 else 263 { 264 CPLString osBasePath = CPLGetPath(poOpenInfo->pszFilename); 265 osFilename = CPLFormFilename( osBasePath, osFilename, NULL); 266 } 267 268 FILE *fpRaw = VSIFOpenL( osFilename, "rb" ); 264 269 if( fpRaw == NULL ) 265 270 { 266 271 CPLError( CE_Failure, CPLE_AppDefined, 267 272 "Failed to open band file: %s", 268 pszFilename);273 osFilename.c_str() ); 269 274 delete poDS; 270 275 return NULL; … … 272 277 poDS->papszExtraFiles = 273 278 CSLAddString( poDS->papszExtraFiles, 274 pszFilename );279 osFilename ); 275 280 276 281 RawRasterBand *poBand =
