From e84a38cf471105cb888595baeb858a02e4c301fe Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 6 Nov 2015 14:13:20 +0100 Subject: Adding upstream version 1.0. Signed-off-by: Daniel Baumann --- main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 11d733b..0649d1d 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,5 @@ /* Lunzip - Decompressor for lzip files - Copyright (C) 2010 Antonio Diaz Diaz. + Copyright (C) 2010, 2011 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ long long int llabs( long long int number ); const char * const Program_name = "Lunzip"; const char * const program_name = "lunzip"; -const char * const program_year = "2010"; +const char * const program_year = "2011"; const char * invocation_name = 0; #ifdef O_BINARY @@ -106,7 +106,7 @@ static void show_help() printf( " -h, --help display this help and exit\n" ); printf( " -V, --version output version information and exit\n" ); printf( " -c, --stdout send output to standard output\n" ); - printf( " -d, --decompress decompress\n" ); + printf( " -d, --decompress decompress (this is the default)\n" ); printf( " -f, --force overwrite existing output files\n" ); printf( " -k, --keep keep (don't delete) input files\n" ); printf( " -o, --output= if reading stdin, place the output into \n" ); @@ -260,9 +260,10 @@ static void close_and_set_permissions( const struct stat * const in_statsp ) bool error = false; if( in_statsp ) { - if( fchmod( outfd, in_statsp->st_mode ) != 0 || - ( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) != 0 && - errno != EPERM ) ) error = true; + if( ( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) != 0 && + errno != EPERM ) || + fchmod( outfd, in_statsp->st_mode ) != 0 ) + error = true; /* fchown will in many cases return with EPERM, which can be safely ignored. */ } if( close( outfd ) == 0 ) outfd = -1; -- cgit v1.2.3