From e83684e70d693debd8ec1beee56507507ccd1ec9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 06:00:36 +0100 Subject: Adding upstream version 1.3~rc1. Signed-off-by: Daniel Baumann --- main.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 9ba2280..75c4ea9 100644 --- a/main.c +++ b/main.c @@ -15,7 +15,7 @@ along with this program. If not, see . */ /* - Return values: 0 for a normal exit, 1 for environmental problems + Exit status: 0 for a normal exit, 1 for environmental problems (file not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or invalid input file, 3 for an internal consistency error (eg, bug) which caused lunzip to panic. @@ -51,7 +51,7 @@ #endif #include "carg_parser.h" -#include "lunzip.h" +#include "lzip.h" #include "decoder.h" #if CHAR_BIT != 8 @@ -101,6 +101,10 @@ static void show_help( void ) " -v, --verbose be verbose (a 2nd -v gives more)\n" "If no file names are given, lunzip decompresses from standard input to\n" "standard output.\n" + "\nExit status: 0 for a normal exit, 1 for environmental problems (file\n" + "not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or\n" + "invalid input file, 3 for an internal consistency error (eg, bug) which\n" + "caused lunzip to panic.\n" "\nReport bugs to lzip-bug@nongnu.org\n" "Lunzip home page: http://www.nongnu.org/lzip/lunzip.html\n" ); } @@ -129,8 +133,9 @@ void show_header( const File_header header ) for( i = 0; i < 8 && ( num > 9999 || ( exact && num >= factor ) ); ++i ) { num /= factor; if( num % factor != 0 ) exact = false; p = prefix[i]; np = ""; } - fprintf( stderr, "version %d, dictionary size %s%4u %sB. ", - Fh_version( header ), np, num, p ); + if( verbosity >= 4 ) + fprintf( stderr, "version %d, ", Fh_version( header ) ); + fprintf( stderr, "dictionary size %s%4u %sB. ", np, num, p ); } @@ -326,7 +331,7 @@ static int decompress( const int infd, struct Pretty_print * const pp, retval = 2; break; } if( verbosity >= 2 || ( verbosity == 1 && first_member ) ) - { Pp_show_msg( pp, 0 ); if( verbosity >= 2 ) show_header( header ); } + { Pp_show_msg( pp, 0 ); if( verbosity >= 3 ) show_header( header ); } if( !LZd_init( &decoder, header, &rdec, outfd ) ) { @@ -350,13 +355,11 @@ static int decompress( const int infd, struct Pretty_print * const pp, retval = 2; break; } if( verbosity >= 2 ) - { if( testing ) fprintf( stderr, "ok\n" ); - else fprintf( stderr, "done\n" ); Pp_reset( pp ); } + { fprintf( stderr, testing ? "ok\n" : "done\n" ); Pp_reset( pp ); } } Rd_free( &rdec ); if( verbosity == 1 && retval == 0 ) - { if( testing ) fprintf( stderr, "ok\n" ); - else fprintf( stderr, "done\n" ); } + fprintf( stderr, testing ? "ok\n" : "done\n" ); return retval; } @@ -448,6 +451,7 @@ int main( const int argc, const char * const argv[] ) { 'f', "force", ap_no }, { 'h', "help", ap_no }, { 'k', "keep", ap_no }, + { 'n', "threads", ap_yes }, { 'o', "output", ap_yes }, { 'q', "quiet", ap_no }, { 't', "test", ap_no }, @@ -477,6 +481,7 @@ int main( const int argc, const char * const argv[] ) case 'f': force = true; break; case 'h': show_help(); return 0; case 'k': keep_input_files = true; break; + case 'n': break; case 'o': default_output_filename = arg; break; case 'q': verbosity = -1; break; case 't': testing = true; break; -- cgit v1.2.3