1
0
Fork 0

Adding upstream version 1.18~pre2.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:25:51 +01:00
parent cf6c2d1d59
commit ed1b0d872f
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
18 changed files with 427 additions and 220 deletions

View file

@ -48,16 +48,7 @@ int decompress_member( const int infd, const int outfd,
rdec.read_data( header.data, File_header::size );
if( rdec.finished() ) // End Of File
{ pp( "File ends unexpectedly at member header." ); return 2; }
if( !header.verify_magic() )
{ pp( "Bad magic number (file not in lzip format)." ); return 2; }
if( !header.verify_version() )
{
if( pp.verbosity() >= 0 )
{ pp();
std::fprintf( stderr, "Version %d member format not supported.\n",
header.version() ); }
return 2;
}
if( !verify_header( header, pp ) ) return 2;
const unsigned dictionary_size = header.dictionary_size();
if( dictionary_size < min_dictionary_size ||
dictionary_size > max_dictionary_size )
@ -101,7 +92,12 @@ int list_file( const char * const input_filename, const Pretty_print & pp )
{
const unsigned long long data_size = file_index.data_end();
const unsigned long long file_size = file_index.file_end();
unsigned dictionary_size = 0;
for( long i = 0; i < file_index.members(); ++i )
if( dictionary_size < file_index.dictionary_size( i ) )
dictionary_size = file_index.dictionary_size( i );
pp( 0, stdout );
show_header( dictionary_size, 1 );
if( data_size > 0 && file_size > 0 )
std::printf( "%6.3f:1, %6.3f bits/byte, %5.2f%% saved. ",
(double)data_size / file_size,
@ -123,6 +119,10 @@ int list_file( const char * const input_filename, const Pretty_print & pp )
db.pos(), db.size(), mb.pos(), mb.size() );
}
}
const long long trailing_size = file_index.file_size() - file_index.file_end();
if( pp.verbosity() >= 1 && trailing_size > 0 )
std::printf( " %lld bytes of trailing data at end of file.\n",
trailing_size );
}
return 0;
}