diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 10:21:46 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 10:21:46 +0000 |
commit | 6f083d3eb74f473c38c623693aedfe30599c54e3 (patch) | |
tree | fb1c97d85391151ed0b251e9025f047739a470d2 /main.cc | |
parent | Adding debian version 1.14~rc1-1. (diff) | |
download | lziprecover-6f083d3eb74f473c38c623693aedfe30599c54e3.tar.xz lziprecover-6f083d3eb74f473c38c623693aedfe30599c54e3.zip |
Merging upstream version 1.14~rc2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r-- | main.cc | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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; } |