1
0
Fork 0

Merging upstream version 1.25~rc1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:33:25 +01:00
parent 1d67e88e3c
commit b8e73cb85f
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
39 changed files with 978 additions and 742 deletions

View file

@ -53,7 +53,7 @@ bool decompress_member( const int infd, const Cl_options & cl_opts,
if( verbosity >= 2 ) pp();
LZ_decoder decoder( rdec, dictionary_size, outfd, outskip, outend );
const int result = decoder.decode_member( pp, cl_opts.ignore_nonzero );
const int result = decoder.decode_member( pp, cl_opts.ignore_errors );
if( result != 0 )
{
if( verbosity >= 0 && result <= 2 )
@ -94,7 +94,7 @@ const char * format_num( unsigned long long num,
static int current = 0;
static bool si = true;
if( set_prefix ) si = ( set_prefix > 0 );
if( set_prefix ) si = set_prefix > 0;
unsigned long long den = 1;
const unsigned factor = si ? 1000 : 1024;
char * const buf = buffer[current++]; current %= buffers;
@ -112,15 +112,6 @@ const char * format_num( unsigned long long num,
}
bool safe_seek( const int fd, const long long pos,
const char * const filename )
{
if( lseek( fd, pos, SEEK_SET ) == pos ) return true;
show_file_error( filename, "Seek error", errno );
return false;
}
int range_decompress( const std::string & input_filename,
const std::string & default_output_filename,
const Cl_options & cl_opts, Block range,
@ -171,7 +162,7 @@ int range_decompress( const std::string & input_filename,
const long long outskip = std::max( 0LL, range.pos() - db.pos() );
const long long outend = std::min( db.size(), range.end() - db.pos() );
const long long mpos = lzip_index.mblock( i ).pos();
if( !safe_seek( infd, mpos, filename ) ) cleanup_and_fail( 1 );
if( !safe_seek( infd, mpos, input_filename ) ) cleanup_and_fail( 1 );
if( !decompress_member( infd, cl_opts, pp, mpos, outskip, outend ) )
{ if( cl_opts.ignore_errors ) error = true; else cleanup_and_fail( 2 ); }
pp.reset();