1
0
Fork 0

Merging upstream version 0.26.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 21:27:57 +01:00
parent 7185f44b62
commit 180f99b04d
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
44 changed files with 610 additions and 505 deletions

View file

@ -20,7 +20,7 @@
#include <cctype>
#include <cerrno>
#include <cstdio>
#include <stdint.h> // for lzlib.h
#include <stdint.h> // for lzlib.h
#include <unistd.h>
#include <lzlib.h>
@ -44,7 +44,7 @@ int tail_copy( const Arg_parser & parser, const Archive_descriptor & ad,
const long long rest = ad.lzip_index.file_size() - istream_pos;
if( istream_pos > 0 && rest > 0 &&
( !safe_seek( ad.infd, istream_pos ) ||
!copy_file( ad.infd, outfd, rest ) ) )
!copy_file( ad.infd, outfd, ad.namep, rest ) ) )
{ show_file_error( ad.namep, "Error during tail copy." );
return retval ? retval : 1; }
const long long ostream_pos = lseek( outfd, 0, SEEK_CUR );
@ -85,6 +85,8 @@ int delete_members( const Cl_options & cl_opts )
{ show_error( "Deleting from stdin not implemented yet." ); return 1; }
const Archive_descriptor ad( cl_opts.archive_name );
if( ad.infd < 0 ) return 1;
if( ad.name.size() && ad.indexed && ad.lzip_index.multi_empty() )
{ show_file_error( ad.namep, empty_msg ); close( ad.infd ); return 2; }
const int outfd = open_outstream( cl_opts.archive_name, false );
if( outfd < 0 ) { close( ad.infd ); return 1; }
@ -177,7 +179,7 @@ int delete_members( const Cl_options & cl_opts )
if( istream_pos == 0 )
{ if( !safe_seek( outfd, size ) ) { retval = 1; break; } }
else if( !safe_seek( ad.infd, istream_pos ) ||
!copy_file( ad.infd, outfd, size ) ||
!copy_file( ad.infd, outfd, ad.namep, size ) ||
!safe_seek( ad.infd, pos ) ) { retval = 1; break; }
}
istream_pos = pos;