summaryrefslogtreecommitdiffstats
path: root/range_dec.cc
diff options
context:
space:
mode:
Diffstat (limited to 'range_dec.cc')
-rw-r--r--range_dec.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/range_dec.cc b/range_dec.cc
index 59be01f..27ceba3 100644
--- a/range_dec.cc
+++ b/range_dec.cc
@@ -101,13 +101,6 @@ void parse_range( const char * const ptr, Block & range )
}
-bool safe_seek( const int fd, const long long pos )
- {
- if( lseek( fd, pos, SEEK_SET ) == pos ) return true;
- show_error( "Seek error", errno ); return false;
- }
-
-
int decompress_member( const int infd, const int outfd,
const Pretty_print & pp,
const unsigned long long mpos,
@@ -170,7 +163,7 @@ int list_file( const std::string & input_filename, const Pretty_print & pp )
const int infd = open_instream( input_filename, &in_stats, true, true );
if( infd < 0 ) return 1;
- File_index file_index( infd );
+ const File_index file_index( infd );
close( infd );
if( file_index.retval() != 0 )
{ show_error( file_index.error().c_str() ); return file_index.retval(); }
@@ -208,6 +201,13 @@ int list_file( const std::string & input_filename, const Pretty_print & pp )
} // end namespace
+bool safe_seek( const int fd, const long long pos )
+ {
+ if( lseek( fd, pos, SEEK_SET ) == pos ) return true;
+ show_error( "Seek error", errno ); return false;
+ }
+
+
int list_files( const std::vector< std::string > & filenames,
const int verbosity )
{
@@ -234,7 +234,7 @@ int range_decompress( const std::string & input_filename,
const int infd = open_instream( input_filename, &in_stats, true, true );
if( infd < 0 ) return 1;
- File_index file_index( infd );
+ const File_index file_index( infd );
if( file_index.retval() != 0 )
{ show_error( file_index.error().c_str() ); return file_index.retval(); }
@@ -259,6 +259,7 @@ int range_decompress( const std::string & input_filename,
else
{ outfd = open_outstream_rw( output_filename, force );
if( outfd < 0 ) return 1; }
+
Pretty_print pp( input_filename, verbosity );
int retval = 0;
for( int i = 0; i < file_index.members(); ++i )