summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:21:46 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:21:46 +0000
commit6f083d3eb74f473c38c623693aedfe30599c54e3 (patch)
treefb1c97d85391151ed0b251e9025f047739a470d2 /main.cc
parentAdding debian version 1.14~rc1-1. (diff)
downloadlziprecover-6f083d3eb74f473c38c623693aedfe30599c54e3.tar.xz
lziprecover-6f083d3eb74f473c38c623693aedfe30599c54e3.zip
Merging upstream version 1.14~rc2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/main.cc b/main.cc
index 0b7a88a..df55c79 100644
--- a/main.cc
+++ b/main.cc
@@ -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;
}