Open tbonfort opened 12 years ago
Author: fwarmerdam Date: 2006/04/18 - 19:30
Nikita,
I was aware of this problem, but I wasn't aware I could check for
the EFBIG error. I have modified the patch a bit to work on platforms
without EFBIG defined, and to be a bit more explanitory.
/*
** Try to open the file, and read the first 8 bytes as a signature.
** If the open fails for a reason other than "bigness" then we use
** the filename unaltered by path logic since it might be something
** very virtual.
*/
f = fopen( szPath, "rb");
if(!f) {
memset( dd, 0, 8 );
#ifdef EFBIG
if( errno != EFBIG )
strcpy( szPath, filename );
#else
strcpy( szPath, filename );
#endif
} else {
fread(dd,8,1,f); /* read some bytes to try and identify the file */
fclose(f);
}
I have only incorporated this patch into 4.9. It could go into 4.8 branch
but I'm a bit nervous about it still.
Please reopen if you feel this should go into 4.8 branch.
Reporter: malfet@jscc.ru Date: 2006/04/17 - 16:29