mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
parent
49c6ae7032
commit
0c7d7ada21
|
@ -131,7 +131,7 @@ void Babylon::close()
|
||||||
|
|
||||||
bool Babylon::readBlock( bgl_block &block )
|
bool Babylon::readBlock( bgl_block &block )
|
||||||
{
|
{
|
||||||
if( gzeof( file ) || file == NULL )
|
if ( file == NULL || gzeof( file ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
block.length = bgl_readnum( 1 );
|
block.length = bgl_readnum( 1 );
|
||||||
|
@ -346,19 +346,19 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
{
|
{
|
||||||
switch( block.type )
|
switch( block.type )
|
||||||
{
|
{
|
||||||
case 2:
|
case 2: {
|
||||||
{
|
// the block data may have length==0
|
||||||
pos = 0;
|
if ( block.length == 0 )
|
||||||
len = (unsigned char)block.data[pos++];
|
|
||||||
if( pos + len > block.length )
|
|
||||||
break;
|
break;
|
||||||
std::string filename( block.data+pos, len );
|
pos = 0;
|
||||||
|
len = (unsigned char)block.data[ pos++ ];
|
||||||
|
if ( pos + len > block.length )
|
||||||
|
break;
|
||||||
|
std::string filename( block.data + pos, len );
|
||||||
//if (filename != "8EAF66FD.bmp" && filename != "C2EEF3F6.html") {
|
//if (filename != "8EAF66FD.bmp" && filename != "C2EEF3F6.html") {
|
||||||
pos += len;
|
pos += len;
|
||||||
if ( resourceHandler )
|
if ( resourceHandler )
|
||||||
resourceHandler->handleBabylonResource( filename,
|
resourceHandler->handleBabylonResource( filename, block.data + pos, block.length - pos );
|
||||||
block.data + pos,
|
|
||||||
block.length - pos );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
|
Loading…
Reference in a new issue