1
0
Fork 0

Merging upstream version 1.14~rc2.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:12:17 +01:00
parent f54b7304c4
commit bd5ef2f1cc
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
11 changed files with 143 additions and 129 deletions

12
main.cc
View file

@ -145,8 +145,9 @@ void show_header( const File_header & header )
for( int i = 0; i < 8 && ( num > 9999 || ( exact && num >= factor ) ); ++i )
{ num /= factor; if( num % factor != 0 ) exact = false;
p = prefix[i]; np = ""; }
std::fprintf( stderr, "version %d, dictionary size %s%4u %sB. ",
header.version(), np, num, p );
if( verbosity >= 4 )
std::fprintf( stderr, "version %d, ", header.version() );
std::fprintf( stderr, "dictionary size %s%4u %sB. ", np, num, p );
}
namespace {
@ -359,7 +360,6 @@ void show_trailing_garbage( const uint8_t * const data, const int size,
int decompress( const int infd, const Pretty_print & pp, const bool testing )
{
const char * const ok_msg = ( testing ? "ok\n" : "done\n" );
int retval = 0;
try {
@ -418,7 +418,8 @@ int decompress( const int infd, const Pretty_print & pp, const bool testing )
}
retval = 2; break;
}
if( verbosity >= 2 ) { std::fprintf( stderr, ok_msg ); pp.reset(); }
if( verbosity >= 2 )
{ std::fprintf( stderr, testing ? "ok\n" : "done\n" ); pp.reset(); }
}
}
catch( std::bad_alloc )
@ -427,7 +428,8 @@ int decompress( const int infd, const Pretty_print & pp, const bool testing )
retval = 1;
}
catch( Error e ) { pp(); show_error( e.msg, errno ); retval = 1; }
if( verbosity == 1 && retval == 0 ) std::fprintf( stderr, ok_msg );
if( verbosity == 1 && retval == 0 )
std::fprintf( stderr, testing ? "ok\n" : "done\n" );
return retval;
}