summaryrefslogtreecommitdiffstats
path: root/range_dec.cc
diff options
context:
space:
mode:
Diffstat (limited to 'range_dec.cc')
-rw-r--r--range_dec.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/range_dec.cc b/range_dec.cc
index 0bb3078..23e18d5 100644
--- a/range_dec.cc
+++ b/range_dec.cc
@@ -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();