1
0
Fork 0

Adding upstream version 1.18~pre2.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:25:51 +01:00
parent cf6c2d1d59
commit ed1b0d872f
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
18 changed files with 427 additions and 220 deletions

View file

@ -62,25 +62,6 @@ bool next_filename( std::string & output_filename, const int max_digits )
}
bool verify_header( const File_header & header, const Pretty_print & pp )
{
if( !header.verify_magic() )
{
pp( "Bad magic number (file not in lzip format)." );
return false;
}
if( !header.verify_version() )
{
if( pp.verbosity() >= 0 )
{ pp();
std::fprintf( stderr, "Version %d member format not supported.\n",
header.version() ); }
return false;
}
return true;
}
// Search forward from 'pos' for "LZIP" (Boyer-Moore algorithm)
// Returns pos of found string or 'pos+size' if not found.
//
@ -205,6 +186,25 @@ int do_split_file( const std::string & input_filename, uint8_t * & base_buffer,
} // end namespace
bool verify_header( const File_header & header, const Pretty_print & pp )
{
if( !header.verify_magic() )
{
pp( "Bad magic number (file not in lzip format)." );
return false;
}
if( !header.verify_version() )
{
if( pp.verbosity() >= 0 )
{ pp();
std::fprintf( stderr, "Version %d member format not supported.\n",
header.version() ); }
return false;
}
return true;
}
int split_file( const std::string & input_filename,
const std::string & default_output_filename,
const int verbosity, const bool force )