1
0
Fork 0

Merging upstream version 1.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 21:54:20 +01:00
parent 38137c31f4
commit 590e419a4b
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
13 changed files with 30 additions and 30 deletions

13
main.c
View file

@ -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=<file> if reading stdin, place the output into <file>\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;