1
0
Fork 0

Merging upstream version 1.7.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 22:20:49 +01:00
parent 2c9a359ab6
commit 5b51478421
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
10 changed files with 34 additions and 50 deletions

View file

@ -1,6 +1,6 @@
2015-03-26 Antonio Diaz Diaz <antonio@gnu.org> 2015-05-27 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.7-pre1 released. * Version 1.7 released.
* Minor changes. * Minor changes.
* Makefile.in: Added new targets 'install*-compress'. * Makefile.in: Added new targets 'install*-compress'.

View file

@ -1,7 +1,7 @@
Requirements Requirements
------------ ------------
You will need a C compiler. You will need a C compiler.
I use gcc 4.9.1 and 3.3.6, but the code should compile with any I use gcc 4.9.1 and 4.1.2, but the code should compile with any
standards compliant compiler. standards compliant compiler.
Gcc is available at http://gcc.gnu.org. Gcc is available at http://gcc.gnu.org.

View file

@ -18,13 +18,13 @@ objs = carg_parser.o decoder.o main.o
all : $(progname) all : $(progname)
$(progname) : $(objs) $(progname) : $(objs)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs) $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(objs)
main.o : main.c main.o : main.c
$(CC) $(CFLAGS) $(CPPFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $< $(CC) $(CPPFLAGS) $(CFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $<
%.o : %.c %.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
$(objs) : Makefile $(objs) : Makefile
carg_parser.o : carg_parser.h carg_parser.o : carg_parser.h

View file

@ -1,28 +1,20 @@
/* Arg_parser - POSIX/GNU command line argument parser. (C version) /* Arg_parser - POSIX/GNU command line argument parser. (C version)
Copyright (C) 2006-2015 Antonio Diaz Diaz. Copyright (C) 2006-2015 Antonio Diaz Diaz.
This library is free software: you can redistribute it and/or modify This library is free software. Redistribution and use in source and
it under the terms of the GNU General Public License as published by binary forms, with or without modification, are permitted provided
the Free Software Foundation, either version 2 of the License, or that the following conditions are met:
(at your option) any later version.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library. If not, see <http://www.gnu.org/licenses/>.
As a special exception, you may use this file as part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this
file, or you compile this file and link it with other files to
produce an executable, this file does not by itself cause the
resulting executable to be covered by the GNU General Public
License. This exception does not however invalidate any other
reasons why the executable file might be covered by the GNU General
Public License.
*/ */
#include <stdlib.h> #include <stdlib.h>

View file

@ -1,28 +1,20 @@
/* Arg_parser - POSIX/GNU command line argument parser. (C version) /* Arg_parser - POSIX/GNU command line argument parser. (C version)
Copyright (C) 2006-2015 Antonio Diaz Diaz. Copyright (C) 2006-2015 Antonio Diaz Diaz.
This library is free software: you can redistribute it and/or modify This library is free software. Redistribution and use in source and
it under the terms of the GNU General Public License as published by binary forms, with or without modification, are permitted provided
the Free Software Foundation, either version 2 of the License, or that the following conditions are met:
(at your option) any later version.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library. If not, see <http://www.gnu.org/licenses/>.
As a special exception, you may use this file as part of a free
software library without restriction. Specifically, if other files
instantiate templates or use macros or inline functions from this
file, or you compile this file and link it with other files to
produce an executable, this file does not by itself cause the
resulting executable to be covered by the GNU General Public
License. This exception does not however invalidate any other
reasons why the executable file might be covered by the GNU General
Public License.
*/ */
/* Arg_parser reads the arguments in 'argv' and creates a number of /* Arg_parser reads the arguments in 'argv' and creates a number of

2
configure vendored
View file

@ -6,7 +6,7 @@
# to copy, distribute and modify it. # to copy, distribute and modify it.
pkgname=lunzip pkgname=lunzip
pkgversion=1.7-pre1 pkgversion=1.7
progname=lunzip progname=lunzip
srctrigger=doc/${progname}.1 srctrigger=doc/${progname}.1

View file

@ -222,7 +222,7 @@ int LZd_decode_member( struct LZ_decoder * const d,
const int pos_state = LZd_data_position( d ) & pos_state_mask; const int pos_state = LZd_data_position( d ) & pos_state_mask;
if( Rd_decode_bit( rdec, &d->bm_match[state][pos_state] ) == 0 ) /* 1st bit */ if( Rd_decode_bit( rdec, &d->bm_match[state][pos_state] ) == 0 ) /* 1st bit */
{ {
const uint8_t prev_byte = LZd_peek1( d ); const uint8_t prev_byte = LZd_peek_prev( d );
if( St_is_char( state ) ) if( St_is_char( state ) )
{ {
state -= ( state < 4 ) ? state : 3; state -= ( state < 4 ) ? state : 3;

View file

@ -259,7 +259,7 @@ void LZd_flush_data( struct LZ_decoder * const d );
int seek_read( const int fd, uint8_t * const buf, const int size, int seek_read( const int fd, uint8_t * const buf, const int size,
const int offset ); const int offset );
static inline uint8_t LZd_peek1( const struct LZ_decoder * const d ) static inline uint8_t LZd_peek_prev( const struct LZ_decoder * const d )
{ {
const int i = ( ( d->pos > 0 ) ? d->pos : d->buffer_size ) - 1; const int i = ( ( d->pos > 0 ) ? d->pos : d->buffer_size ) - 1;
return d->buffer[i]; return d->buffer[i];

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.1. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.1.
.TH LUNZIP "1" "March 2015" "lunzip 1.7-pre1" "User Commands" .TH LUNZIP "1" "May 2015" "lunzip 1.7" "User Commands"
.SH NAME .SH NAME
lunzip \- decompressor for lzip files lunzip \- decompressor for lzip files
.SH SYNOPSIS .SH SYNOPSIS

4
main.c
View file

@ -168,7 +168,7 @@ static unsigned long getnum( const char * const ptr,
if( !errno && tail[0] ) if( !errno && tail[0] )
{ {
int factor = ( tail[1] == 'i' ) ? 1024 : 1000; const int factor = ( tail[1] == 'i' ) ? 1024 : 1000;
int exponent = 0, i; int exponent = 0, i;
bool bad_multiplier = false; bool bad_multiplier = false;
switch( tail[0] ) switch( tail[0] )
@ -211,7 +211,7 @@ static unsigned long getnum( const char * const ptr,
static int get_dict_size( const char * const arg ) static int get_dict_size( const char * const arg )
{ {
char * tail; char * tail;
int bits = strtol( arg, &tail, 0 ); const int bits = strtol( arg, &tail, 0 );
if( bits >= min_dictionary_bits && if( bits >= min_dictionary_bits &&
bits <= max_dictionary_bits && *tail == 0 ) bits <= max_dictionary_bits && *tail == 0 )
return ( 1 << bits ); return ( 1 << bits );