summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:21:37 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:21:37 +0000
commit6dd9ce29d362e14f0350f18999f9812232595d57 (patch)
tree5688a3634ad32fafa4580b15375aee7e5b40ae99 /main.cc
parentAdding upstream version 1.14~rc1. (diff)
downloadlziprecover-6dd9ce29d362e14f0350f18999f9812232595d57.tar.xz
lziprecover-6dd9ce29d362e14f0350f18999f9812232595d57.zip
Adding upstream version 1.14~rc2.upstream/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;
}