Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
Added missing patch from debian distribution (0.1.5.9+cvs.2007.04.28-…
Browse files Browse the repository at this point in the history
…5.1)
  • Loading branch information
sanelson committed Jan 3, 2014
1 parent e4a99d2 commit 8b05663
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions src/zipinputstreambuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,33 @@ ConstEntryPointer ZipInputStreambuf::getNextEntry() {

// read the zip local header
istream is( _inbuf ) ; // istream does not destroy the streambuf.
is.exceptions( ios::eofbit | ios::failbit | ios::badbit );

try {
is >> _curr_entry ;
if ( _curr_entry.isValid() ) {
_data_start = _inbuf->pubseekoff(0, ios::cur, ios::in);
if ( _curr_entry.getMethod() == DEFLATED ) {
_open_entry = true ;
reset() ; // reset inflatestream data structures
// cerr << "deflated" << endl ;
} else if ( _curr_entry.getMethod() == STORED ) {
_open_entry = true ;
_remain = _curr_entry.getSize() ;
// Force underflow on first read:
setg( &( _outvec[ 0 ] ),
&( _outvec[ 0 ] ) + _outvecsize,
&( _outvec[ 0 ] ) + _outvecsize );
// cerr << "stored" << endl ;
} else {
_open_entry = false ; // Unsupported compression format.
throw FCollException( "Unsupported compression format" ) ;
}
is.exceptions(istream::eofbit | istream::failbit | istream::badbit);
is >> _curr_entry ;
if ( _curr_entry.isValid() ) {
_data_start = _inbuf->pubseekoff(0, ios::cur,
ios::in);
if ( _curr_entry.getMethod() == DEFLATED ) {
_open_entry = true ;
reset() ; // reset inflatestream data structures
// cerr << "deflated" << endl ;
} else if ( _curr_entry.getMethod() == STORED ) {
_open_entry = true ;
_remain = _curr_entry.getSize() ;
// Force underflow on first read:
setg( &( _outvec[ 0 ] ),
&( _outvec[ 0 ] ) + _outvecsize,
&( _outvec[ 0 ] ) + _outvecsize ) ;
// cerr << "stored" << endl ;
} else {
_open_entry = false ; // Unsupported compression format.
throw FCollException( "Unsupported compression format" ) ;
}
} catch (...) {
} else {
_open_entry = false ;
}

if ( _curr_entry.isValid() && _curr_entry.trailingDataDescriptor() )
throw FCollException( "Trailing data descriptor in zip file not supported" ) ;
throw FCollException( "Trailing data descriptor in zip file not supported" ) ;
return new ZipLocalEntry( _curr_entry ) ;
}

Expand Down

0 comments on commit 8b05663

Please sign in to comment.