Merging upstream version 1.14.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
02cc7331f8
commit
4fbdc37ab6
24 changed files with 98 additions and 112 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,9 +1,10 @@
|
|||
2023-12-20 Antonio Diaz Diaz <antonio@gnu.org>
|
||||
2024-01-22 Antonio Diaz Diaz <antonio@gnu.org>
|
||||
|
||||
* Version 1.14-rc1 released.
|
||||
* Version 1.14 released.
|
||||
* New options '--empty-error' and '--marking-error'.
|
||||
* main.c: Reformat file diagnostics as 'PROGRAM: FILE: MESSAGE'.
|
||||
(show_option_error): New function showing argument and option name.
|
||||
(main): Make -o preserve date/mode/owner if 1 input file.
|
||||
(open_outstream): Create missing intermediate directories.
|
||||
* lzip.h: Rename verify_* to check_*.
|
||||
* configure, Makefile.in: New variable 'MAKEINFO'.
|
||||
|
@ -81,8 +82,8 @@
|
|||
|
||||
* Version 1.8 released.
|
||||
* New option '-a, --trailing-error'.
|
||||
* main.c (decompress): Print up to 6 bytes of trailing data
|
||||
when '-vvvv' is specified.
|
||||
* main.c (decompress): Print up to 6 bytes of trailing data when
|
||||
'-vvvv' is specified.
|
||||
* decoder.c (LZd_verify_trailer): Remove test of final code.
|
||||
* main.c (main): Delete '--output' file if infd is a terminal.
|
||||
* main.c (main): Don't use stdin more than once.
|
||||
|
@ -172,8 +173,7 @@
|
|||
* Translated to C from the C++ source of lzip 1.10.
|
||||
|
||||
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
||||
|
||||
This file is a collection of facts, and thus it is not copyrightable,
|
||||
but just in case, you have unlimited permission to copy, distribute, and
|
||||
modify it.
|
||||
This file is a collection of facts, and thus it is not copyrightable, but just
|
||||
in case, you have unlimited permission to copy, distribute, and modify it.
|
||||
|
|
2
INSTALL
2
INSTALL
|
@ -75,7 +75,7 @@ After running 'configure', you can run 'make' and 'make install' as
|
|||
explained above.
|
||||
|
||||
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
||||
|
||||
This file is free documentation: you have unlimited permission to copy,
|
||||
distribute, and modify it.
|
||||
|
|
3
NEWS
3
NEWS
|
@ -11,6 +11,9 @@ File diagnostics have been reformatted as 'PROGRAM: FILE: MESSAGE'.
|
|||
Diagnostics caused by invalid arguments to command-line options now show the
|
||||
argument and the name of the option.
|
||||
|
||||
The option '-o, --output' now preserves dates, permissions, and ownership of
|
||||
the file when (de)compressing exactly one file.
|
||||
|
||||
The option '-o, --output' now creates missing intermediate directories when
|
||||
writing to a file.
|
||||
|
||||
|
|
14
README
14
README
|
@ -1,9 +1,8 @@
|
|||
Description
|
||||
|
||||
Clzip is a C language version of lzip, fully compatible with lzip 1.4 or
|
||||
newer. As clzip is written in C, it may be easier to integrate in
|
||||
applications like package managers, embedded devices, or systems lacking a
|
||||
C++ compiler.
|
||||
Clzip is a C language version of lzip, compatible with lzip 1.4 or newer. As
|
||||
clzip is written in C, it may be easier to integrate in applications like
|
||||
package managers, embedded devices, or systems lacking a C++ compiler.
|
||||
|
||||
Lzip is a lossless data compressor with a user interface similar to the one
|
||||
of gzip or bzip2. Lzip uses a simplified form of the 'Lempel-Ziv-Markov
|
||||
|
@ -131,11 +130,10 @@ been compressed. Decompressed is used to refer to data which have undergone
|
|||
the process of decompression.
|
||||
|
||||
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
||||
|
||||
This file is free documentation: you have unlimited permission to copy,
|
||||
distribute, and modify it.
|
||||
|
||||
The file Makefile.in is a data file used by configure to produce the
|
||||
Makefile. It has the same copyright owner and permissions that configure
|
||||
itself.
|
||||
The file Makefile.in is a data file used by configure to produce the Makefile.
|
||||
It has the same copyright owner and permissions that configure itself.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Arg_parser - POSIX/GNU command-line argument parser. (C version)
|
||||
Copyright (C) 2006-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2006-2024 Antonio Diaz Diaz.
|
||||
|
||||
This library is free software. Redistribution and use in source and
|
||||
binary forms, with or without modification, are permitted provided
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Arg_parser - POSIX/GNU command-line argument parser. (C version)
|
||||
Copyright (C) 2006-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2006-2024 Antonio Diaz Diaz.
|
||||
|
||||
This library is free software. Redistribution and use in source and
|
||||
binary forms, with or without modification, are permitted provided
|
||||
|
|
6
configure
vendored
6
configure
vendored
|
@ -1,12 +1,12 @@
|
|||
#! /bin/sh
|
||||
# configure script for Clzip - LZMA lossless data compressor
|
||||
# Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
# Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
||||
#
|
||||
# This configure script is free software: you have unlimited permission
|
||||
# to copy, distribute, and modify it.
|
||||
|
||||
pkgname=clzip
|
||||
pkgversion=1.14-rc1
|
||||
pkgversion=1.14
|
||||
progname=clzip
|
||||
srctrigger=doc/${pkgname}.texi
|
||||
|
||||
|
@ -171,7 +171,7 @@ echo "MAKEINFO = ${MAKEINFO}"
|
|||
rm -f Makefile
|
||||
cat > Makefile << EOF
|
||||
# Makefile for Clzip - LZMA lossless data compressor
|
||||
# Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
# Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
||||
# This file was generated automatically by configure. Don't edit.
|
||||
#
|
||||
# This Makefile is free software: you have unlimited permission
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
11
doc/clzip.1
11
doc/clzip.1
|
@ -1,15 +1,14 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
||||
.TH CLZIP "1" "December 2023" "clzip 1.14-rc1" "User Commands"
|
||||
.TH CLZIP "1" "January 2024" "clzip 1.14" "User Commands"
|
||||
.SH NAME
|
||||
clzip \- reduces the size of files
|
||||
.SH SYNOPSIS
|
||||
.B clzip
|
||||
[\fI\,options\/\fR] [\fI\,files\/\fR]
|
||||
.SH DESCRIPTION
|
||||
Clzip is a C language version of lzip, fully compatible with lzip 1.4 or
|
||||
newer. As clzip is written in C, it may be easier to integrate in
|
||||
applications like package managers, embedded devices, or systems lacking a
|
||||
C++ compiler.
|
||||
Clzip is a C language version of lzip, compatible with lzip 1.4 or newer. As
|
||||
clzip is written in C, it may be easier to integrate in applications like
|
||||
package managers, embedded devices, or systems lacking a C++ compiler.
|
||||
.PP
|
||||
Lzip is a lossless data compressor with a user interface similar to the one
|
||||
of gzip or bzip2. Lzip uses a simplified form of the 'Lempel\-Ziv\-Markov
|
||||
|
@ -123,7 +122,7 @@ Report bugs to lzip\-bug@nongnu.org
|
|||
.br
|
||||
Clzip home page: http://www.nongnu.org/lzip/clzip.html
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2023 Antonio Diaz Diaz.
|
||||
Copyright \(co 2024 Antonio Diaz Diaz.
|
||||
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
|
||||
.br
|
||||
This is free software: you are free to change and redistribute it.
|
||||
|
|
|
@ -11,7 +11,7 @@ File: clzip.info, Node: Top, Next: Introduction, Up: (dir)
|
|||
Clzip Manual
|
||||
************
|
||||
|
||||
This manual is for Clzip (version 1.14-rc1, 20 December 2023).
|
||||
This manual is for Clzip (version 1.14, 22 January 2024).
|
||||
|
||||
* Menu:
|
||||
|
||||
|
@ -29,7 +29,7 @@ This manual is for Clzip (version 1.14-rc1, 20 December 2023).
|
|||
* Concept index:: Index of concepts
|
||||
|
||||
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
||||
|
||||
This manual is free documentation: you have unlimited permission to copy,
|
||||
distribute, and modify it.
|
||||
|
@ -40,10 +40,9 @@ File: clzip.info, Node: Introduction, Next: Output, Prev: Top, Up: Top
|
|||
1 Introduction
|
||||
**************
|
||||
|
||||
Clzip is a C language version of lzip, fully compatible with lzip 1.4 or
|
||||
newer. As clzip is written in C, it may be easier to integrate in
|
||||
applications like package managers, embedded devices, or systems lacking a
|
||||
C++ compiler.
|
||||
Clzip is a C language version of lzip, compatible with lzip 1.4 or newer.
|
||||
As clzip is written in C, it may be easier to integrate in applications like
|
||||
package managers, embedded devices, or systems lacking a C++ compiler.
|
||||
|
||||
Lzip is a lossless data compressor with a user interface similar to the
|
||||
one of gzip or bzip2. Lzip uses a simplified form of the 'Lempel-Ziv-Markov
|
||||
|
@ -464,14 +463,9 @@ method is far more difficult.
|
|||
Lzip has been designed, written, and tested with great care to replace
|
||||
gzip and bzip2 as the standard general-purpose compressed format for
|
||||
Unix-like systems. This chapter describes the lessons learned from these
|
||||
previous formats, and their application to the design of lzip.
|
||||
|
||||
Lzip is developed by volunteers who lack the resources required for
|
||||
extensive testing in all circumstances. It is up to you to test lzip before
|
||||
using it in mission-critical applications. However, a compressor like lzip
|
||||
is not a toy, and maintaining it is not a hobby. Many people's data depend
|
||||
on it. Therefore the lzip file format has been reviewed carefully and is
|
||||
believed to be free from negligent design errors.
|
||||
previous formats, and their application to the design of lzip. The lzip
|
||||
format specification has been reviewed carefully and is believed to be free
|
||||
from design errors.
|
||||
|
||||
|
||||
4.1 Format design
|
||||
|
@ -1016,8 +1010,7 @@ decoded) and 'code' (representing the current point within 'range').
|
|||
'range' is initialized to 2^32 - 1, and 'code' is initialized to 0.
|
||||
|
||||
The range encoder produces a first 0 byte that must be ignored by the
|
||||
range decoder. This is done by shifting 5 bytes in the initialization of
|
||||
'code' instead of 4. (See the 'Range_decoder' constructor in the source).
|
||||
range decoder. (See the 'Range_decoder' constructor in the source).
|
||||
|
||||
|
||||
7.4 Decoding and checking the LZMA stream
|
||||
|
@ -1197,7 +1190,7 @@ Appendix A Reference source code
|
|||
********************************
|
||||
|
||||
/* Lzd - Educational decompressor for the lzip format
|
||||
Copyright (C) 2013-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2013-2024 Antonio Diaz Diaz.
|
||||
|
||||
This program is free software. Redistribution and use in source and
|
||||
binary forms, with or without modification, are permitted provided
|
||||
|
@ -1368,9 +1361,9 @@ public:
|
|||
return symbol;
|
||||
}
|
||||
|
||||
unsigned decode_bit( Bit_model & bm )
|
||||
bool decode_bit( Bit_model & bm )
|
||||
{
|
||||
unsigned symbol;
|
||||
bool symbol;
|
||||
const uint32_t bound = ( range >> bit_model_total_bits ) * bm.probability;
|
||||
if( code < bound )
|
||||
{
|
||||
|
@ -1416,8 +1409,8 @@ public:
|
|||
unsigned symbol = 1;
|
||||
for( int i = 7; i >= 0; --i )
|
||||
{
|
||||
const unsigned match_bit = ( match_byte >> i ) & 1;
|
||||
const unsigned bit = decode_bit( bm[symbol+(match_bit<<8)+0x100] );
|
||||
const bool match_bit = ( match_byte >> i ) & 1;
|
||||
const bool bit = decode_bit( bm[symbol+(match_bit<<8)+0x100] );
|
||||
symbol = ( symbol << 1 ) | bit;
|
||||
if( match_bit != bit )
|
||||
{
|
||||
|
@ -1621,7 +1614,7 @@ int main( const int argc, const char * const argv[] )
|
|||
"See the lzip manual for an explanation of the code.\n"
|
||||
"\nUsage: %s [-d] < file.lz > file\n"
|
||||
"Lzd decompresses from standard input to standard output.\n"
|
||||
"\nCopyright (C) 2023 Antonio Diaz Diaz.\n"
|
||||
"\nCopyright (C) 2024 Antonio Diaz Diaz.\n"
|
||||
"License 2-clause BSD.\n"
|
||||
"This is free software: you are free to change and redistribute it.\n"
|
||||
"There is NO WARRANTY, to the extent permitted by law.\n"
|
||||
|
@ -1714,22 +1707,22 @@ Concept index
|
|||
|
||||
Tag Table:
|
||||
Node: Top205
|
||||
Node: Introduction1212
|
||||
Node: Output7342
|
||||
Node: Invoking clzip8945
|
||||
Ref: --trailing-error9823
|
||||
Node: Quality assurance19929
|
||||
Node: Algorithm29060
|
||||
Node: File format32468
|
||||
Ref: coded-dict-size33898
|
||||
Node: Stream format35129
|
||||
Ref: what-is-coded37525
|
||||
Node: Trailing data46478
|
||||
Node: Examples48816
|
||||
Ref: concat-example50266
|
||||
Node: Problems51496
|
||||
Node: Reference source code52032
|
||||
Node: Concept index67094
|
||||
Node: Introduction1207
|
||||
Node: Output7331
|
||||
Node: Invoking clzip8934
|
||||
Ref: --trailing-error9812
|
||||
Node: Quality assurance19918
|
||||
Node: Algorithm28733
|
||||
Node: File format32141
|
||||
Ref: coded-dict-size33571
|
||||
Node: Stream format34802
|
||||
Ref: what-is-coded37198
|
||||
Node: Trailing data46072
|
||||
Node: Examples48410
|
||||
Ref: concat-example49860
|
||||
Node: Problems51090
|
||||
Node: Reference source code51626
|
||||
Node: Concept index66672
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
@finalout
|
||||
@c %**end of header
|
||||
|
||||
@set UPDATED 20 December 2023
|
||||
@set VERSION 1.14-rc1
|
||||
@set UPDATED 22 January 2024
|
||||
@set VERSION 1.14
|
||||
|
||||
@dircategory Compression
|
||||
@direntry
|
||||
|
@ -51,7 +51,7 @@ This manual is for Clzip (version @value{VERSION}, @value{UPDATED}).
|
|||
@end menu
|
||||
|
||||
@sp 1
|
||||
Copyright @copyright{} 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright @copyright{} 2010-2024 Antonio Diaz Diaz.
|
||||
|
||||
This manual is free documentation: you have unlimited permission to copy,
|
||||
distribute, and modify it.
|
||||
|
@ -63,10 +63,9 @@ distribute, and modify it.
|
|||
@cindex introduction
|
||||
|
||||
@uref{http://www.nongnu.org/lzip/clzip.html,,Clzip}
|
||||
is a C language version of lzip, fully compatible with @w{lzip 1.4} or
|
||||
newer. As clzip is written in C, it may be easier to integrate in
|
||||
applications like package managers, embedded devices, or systems lacking a
|
||||
C++ compiler.
|
||||
is a C language version of lzip, compatible with @w{lzip 1.4} or newer.
|
||||
As clzip is written in C, it may be easier to integrate in applications like
|
||||
package managers, embedded devices, or systems lacking a C++ compiler.
|
||||
|
||||
@uref{http://www.nongnu.org/lzip/lzip.html,,Lzip}
|
||||
is a lossless data compressor with a user interface similar to the one
|
||||
|
@ -516,14 +515,9 @@ method is far more difficult.@*
|
|||
Lzip has been designed, written, and tested with great care to replace gzip
|
||||
and bzip2 as the standard general-purpose compressed format for Unix-like
|
||||
systems. This chapter describes the lessons learned from these previous
|
||||
formats, and their application to the design of lzip.
|
||||
|
||||
Lzip is developed by volunteers who lack the resources required for
|
||||
extensive testing in all circumstances. It is up to you to test lzip before
|
||||
using it in mission-critical applications. However, a compressor like lzip
|
||||
is not a toy, and maintaining it is not a hobby. Many people's data depend
|
||||
on it. Therefore the lzip file format has been reviewed carefully and is
|
||||
believed to be free from negligent design errors.
|
||||
formats, and their application to the design of lzip. The lzip format
|
||||
specification has been reviewed carefully and is believed to be free from
|
||||
design errors.
|
||||
|
||||
@sp 1
|
||||
@section Format design
|
||||
|
@ -1092,9 +1086,7 @@ not yet decoded) and @samp{code} (representing the current point within
|
|||
@samp{code} is initialized to 0.
|
||||
|
||||
The range encoder produces a first 0 byte that must be ignored by the
|
||||
range decoder. This is done by shifting 5 bytes in the initialization of
|
||||
@samp{code} instead of 4. (See the @samp{Range_decoder} constructor in
|
||||
the source).
|
||||
range decoder. (See the @samp{Range_decoder} constructor in the source).
|
||||
|
||||
@sp 1
|
||||
@section Decoding and checking the LZMA stream
|
||||
|
@ -1315,7 +1307,7 @@ find by running @w{@samp{clzip --version}}.
|
|||
|
||||
@verbatim
|
||||
/* Lzd - Educational decompressor for the lzip format
|
||||
Copyright (C) 2013-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2013-2024 Antonio Diaz Diaz.
|
||||
|
||||
This program is free software. Redistribution and use in source and
|
||||
binary forms, with or without modification, are permitted provided
|
||||
|
@ -1486,9 +1478,9 @@ public:
|
|||
return symbol;
|
||||
}
|
||||
|
||||
unsigned decode_bit( Bit_model & bm )
|
||||
bool decode_bit( Bit_model & bm )
|
||||
{
|
||||
unsigned symbol;
|
||||
bool symbol;
|
||||
const uint32_t bound = ( range >> bit_model_total_bits ) * bm.probability;
|
||||
if( code < bound )
|
||||
{
|
||||
|
@ -1534,8 +1526,8 @@ public:
|
|||
unsigned symbol = 1;
|
||||
for( int i = 7; i >= 0; --i )
|
||||
{
|
||||
const unsigned match_bit = ( match_byte >> i ) & 1;
|
||||
const unsigned bit = decode_bit( bm[symbol+(match_bit<<8)+0x100] );
|
||||
const bool match_bit = ( match_byte >> i ) & 1;
|
||||
const bool bit = decode_bit( bm[symbol+(match_bit<<8)+0x100] );
|
||||
symbol = ( symbol << 1 ) | bit;
|
||||
if( match_bit != bit )
|
||||
{
|
||||
|
@ -1739,7 +1731,7 @@ int main( const int argc, const char * const argv[] )
|
|||
"See the lzip manual for an explanation of the code.\n"
|
||||
"\nUsage: %s [-d] < file.lz > file\n"
|
||||
"Lzd decompresses from standard input to standard output.\n"
|
||||
"\nCopyright (C) 2023 Antonio Diaz Diaz.\n"
|
||||
"\nCopyright (C) 2024 Antonio Diaz Diaz.\n"
|
||||
"License 2-clause BSD.\n"
|
||||
"This is free software: you are free to change and redistribute it.\n"
|
||||
"There is NO WARRANTY, to the extent permitted by law.\n"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
2
list.c
2
list.c
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
2
lzip.h
2
lzip.h
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
|
19
main.c
19
main.c
|
@ -1,5 +1,5 @@
|
|||
/* Clzip - LZMA lossless data compressor
|
||||
Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2024 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
|
||||
|
@ -80,7 +80,7 @@
|
|||
int verbosity = 0;
|
||||
|
||||
static const char * const program_name = "clzip";
|
||||
static const char * const program_year = "2023";
|
||||
static const char * const program_year = "2024";
|
||||
static const char * invocation_name = "clzip"; /* default value */
|
||||
|
||||
static const struct { const char * from; const char * to; } known_extensions[] = {
|
||||
|
@ -105,10 +105,9 @@ static bool delete_output_on_interrupt = false;
|
|||
|
||||
static void show_help( void )
|
||||
{
|
||||
printf( "Clzip is a C language version of lzip, fully compatible with lzip 1.4 or\n"
|
||||
"newer. As clzip is written in C, it may be easier to integrate in\n"
|
||||
"applications like package managers, embedded devices, or systems lacking a\n"
|
||||
"C++ compiler.\n"
|
||||
printf( "Clzip is a C language version of lzip, compatible with lzip 1.4 or newer. As\n"
|
||||
"clzip is written in C, it may be easier to integrate in applications like\n"
|
||||
"package managers, embedded devices, or systems lacking a C++ compiler.\n"
|
||||
"\nLzip is a lossless data compressor with a user interface similar to the one\n"
|
||||
"of gzip or bzip2. Lzip uses a simplified form of the 'Lempel-Ziv-Markov\n"
|
||||
"chain-Algorithm' (LZMA) stream format to maximize interoperability. The\n"
|
||||
|
@ -621,7 +620,7 @@ static void close_and_set_permissions( const struct stat * const in_statsp )
|
|||
if( in_statsp )
|
||||
{
|
||||
const mode_t mode = in_statsp->st_mode;
|
||||
/* fchown will in many cases return with EPERM, which can be safely ignored. */
|
||||
/* fchown in many cases returns with EPERM, which can be safely ignored. */
|
||||
if( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) == 0 )
|
||||
{ if( fchmod( outfd, mode ) != 0 ) warning = true; }
|
||||
else
|
||||
|
@ -1134,11 +1133,11 @@ int main( const int argc, const char * const argv[] )
|
|||
int retval = 0;
|
||||
const bool one_to_one = !to_stdout && program_mode != m_test && !to_file;
|
||||
bool stdin_used = false;
|
||||
struct stat in_stats;
|
||||
for( i = 0; i < num_filenames; ++i )
|
||||
{
|
||||
const char * input_filename = "";
|
||||
int infd;
|
||||
struct stat in_stats;
|
||||
|
||||
Pp_set_name( &pp, filenames[i] );
|
||||
if( strcmp( filenames[i], "-" ) == 0 )
|
||||
|
@ -1205,7 +1204,9 @@ int main( const int argc, const char * const argv[] )
|
|||
( program_mode != m_compress || volume_size == 0 ) )
|
||||
remove( input_filename );
|
||||
}
|
||||
if( delete_output_on_interrupt ) close_and_set_permissions( 0 ); /* -o */
|
||||
if( delete_output_on_interrupt ) /* -o */
|
||||
close_and_set_permissions( ( retval == 0 && !stdin_used &&
|
||||
filenames_given && num_filenames == 1 ) ? &in_stats : 0 );
|
||||
else if( outfd >= 0 && close( outfd ) != 0 ) /* -c */
|
||||
{
|
||||
show_error( "Error closing stdout", errno, false );
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# check script for Clzip - LZMA lossless data compressor
|
||||
# Copyright (C) 2010-2023 Antonio Diaz Diaz.
|
||||
# Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
||||
#
|
||||
# This script is free software: you have unlimited permission
|
||||
# to copy, distribute, and modify it.
|
||||
|
|
Loading…
Add table
Reference in a new issue