1
0
Fork 0

Merging upstream version 1.17~pre1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:23:19 +01:00
parent 7d611f6ad4
commit 8f2eadfbb8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
17 changed files with 419 additions and 186 deletions

15
main.cc
View file

@ -92,7 +92,14 @@ bool delete_output_on_interrupt = false;
void show_help()
{
std::printf( "%s - Data recovery tool and decompressor for the lzip format.\n", Program_name );
std::printf( "\nUsage: %s [options] [files]\n", invocation_name );
std::printf( "Lziprecover can repair perfectly most files with small errors (up to one\n"
"single-byte error per member), without the need of any extra redundance\n"
"at all. Losing an entire archive just because of a corrupt byte near the\n"
"beginning is a thing of the past.\n"
"Lziprecover can also produce a correct file by merging the good parts of\n"
"two or more damaged copies, extract data from damaged files, decompress\n"
"files and test integrity of files.\n"
"\nUsage: %s [options] [files]\n", invocation_name );
std::printf( "\nOptions:\n"
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
@ -304,10 +311,12 @@ void close_and_set_permissions( const struct stat * const in_statsp )
std::string insert_fixed( std::string name )
{
if( name.size() > 4 && name.compare( name.size() - 4, 4, ".tlz" ) == 0 )
name.insert( name.size() - 4, "_fixed" );
if( name.size() > 7 && name.compare( name.size() - 7, 7, ".tar.lz" ) == 0 )
name.insert( name.size() - 7, "_fixed" );
else if( name.size() > 3 && name.compare( name.size() - 3, 3, ".lz" ) == 0 )
name.insert( name.size() - 3, "_fixed" );
else if( name.size() > 4 && name.compare( name.size() - 4, 4, ".tlz" ) == 0 )
name.insert( name.size() - 4, "_fixed" );
else name += "_fixed.lz";
return name;
}