1
0
Fork 0

Adding upstream version 1.6~pre4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-20 20:23:30 +01:00
parent 73e8cf069d
commit c60d363d17
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
12 changed files with 63 additions and 54 deletions

View file

@ -1,3 +1,8 @@
2014-04-25 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.6-pre4 released.
* Makefile.in: Use 'CFLAGS' in every invocation of 'CC'.
2014-03-30 Antonio Diaz Diaz <antonio@gnu.org> 2014-03-30 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.6-pre3 released. * Version 1.6-pre3 released.

View file

@ -21,31 +21,31 @@ lib$(libname).a : lzlib.o
$(AR) -rcs $@ $< $(AR) -rcs $@ $<
lib$(libname).so.$(pkgversion) : lzlib_sh.o lib$(libname).so.$(pkgversion) : lzlib_sh.o
$(CC) -shared -Wl,--soname=lib$(libname).so.$(soversion) -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) -fpic -fPIC -shared -Wl,--soname=lib$(libname).so.$(soversion) -o $@ $<
$(progname) : $(objs) lib$(libname).a $(progname) : $(objs) lib$(libname).a
$(CC) $(LDFLAGS) -o $@ $(objs) lib$(libname).a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs) lib$(libname).a
$(progname)_shared : $(objs) lib$(libname).so.$(pkgversion) $(progname)_shared : $(objs) lib$(libname).so.$(pkgversion)
$(CC) $(LDFLAGS) -o $@ $(objs) lib$(libname).so.$(pkgversion) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs) lib$(libname).so.$(pkgversion)
$(progname)_profiled : $(objs) lib$(libname).a $(progname)_profiled : $(objs) lib$(libname).a
$(CC) $(LDFLAGS) -pg -o $@ $(objs) lib$(libname).a $(CC) $(CFLAGS) $(LDFLAGS) -pg -o $@ $(objs) lib$(libname).a
bbexample : bbexample.o lib$(libname).a bbexample : bbexample.o lib$(libname).a
$(CC) $(LDFLAGS) -o $@ bbexample.o lib$(libname).a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ bbexample.o lib$(libname).a
lzcheck : lzcheck.o lib$(libname).a lzcheck : lzcheck.o lib$(libname).a
$(CC) $(LDFLAGS) -o $@ lzcheck.o lib$(libname).a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ lzcheck.o lib$(libname).a
main.o : main.c main.o : main.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $< $(CC) $(CFLAGS) $(CPPFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $<
lzlib_sh.o : lzlib.c lzlib_sh.o : lzlib.c
$(CC) -fpic -fPIC $(CPPFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) $(CPPFLAGS) -fpic -fPIC -c -o $@ $<
%.o : %.c %.o : %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
lzdeps = lzlib.h lzip.h cbuffer.c decoder.h decoder.c encoder.h encoder.c lzdeps = lzlib.h lzip.h cbuffer.c decoder.h decoder.c encoder.h encoder.c

View file

@ -176,7 +176,8 @@ static char parse_short_option( struct Arg_parser * const ap,
if( index < 0 ) if( index < 0 )
{ {
add_error( ap, "invalid option -- " ); add_error( ap, code_str ); add_error( ap, "invalid option -- '" ); add_error( ap, code_str );
add_error( ap, "'" );
return 1; return 1;
} }
@ -191,8 +192,8 @@ static char parse_short_option( struct Arg_parser * const ap,
{ {
if( !arg || !arg[0] ) if( !arg || !arg[0] )
{ {
add_error( ap, "option requires an argument -- " ); add_error( ap, "option requires an argument -- '" );
add_error( ap, code_str ); add_error( ap, code_str ); add_error( ap, "'" );
return 1; return 1;
} }
++*argindp; cind = 0; ++*argindp; cind = 0;

2
configure vendored
View file

@ -6,7 +6,7 @@
# to copy, distribute and modify it. # to copy, distribute and modify it.
pkgname=lzlib pkgname=lzlib
pkgversion=1.6-pre3 pkgversion=1.6-pre4
soversion=1 soversion=1
progname=minilzip progname=minilzip
progname_static=${progname} progname_static=${progname}

View file

@ -11,7 +11,7 @@ File: lzlib.info, Node: Top, Next: Introduction, Up: (dir)
Lzlib Manual Lzlib Manual
************ ************
This manual is for Lzlib (version 1.6-pre3, 30 March 2014). This manual is for Lzlib (version 1.6-pre4, 25 April 2014).
* Menu: * Menu:

View file

@ -6,8 +6,8 @@
@finalout @finalout
@c %**end of header @c %**end of header
@set UPDATED 30 March 2014 @set UPDATED 25 April 2014
@set VERSION 1.6-pre3 @set VERSION 1.6-pre4
@dircategory Data Compression @dircategory Data Compression
@direntry @direntry

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
.TH MINILZIP "1" "March 2014" "minilzip 1.6-pre3" "User Commands" .TH MINILZIP "1" "April 2014" "minilzip 1.6-pre4" "User Commands"
.SH NAME .SH NAME
minilzip \- reduces the size of files minilzip \- reduces the size of files
.SH SYNOPSIS .SH SYNOPSIS
@ -83,7 +83,7 @@ Report bugs to lzip\-bug@nongnu.org
Lzlib home page: http://www.nongnu.org/lzip/lzlib.html Lzlib home page: http://www.nongnu.org/lzip/lzlib.html
.SH COPYRIGHT .SH COPYRIGHT
Copyright \(co 2014 Antonio Diaz Diaz. Copyright \(co 2014 Antonio Diaz Diaz.
Using lzlib 1.6\-pre3 Using lzlib 1.6\-pre4
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br .br
This is free software: you are free to change and redistribute it. This is free software: you are free to change and redistribute it.

View file

@ -684,7 +684,7 @@ static bool LZe_encode_member( struct LZ_encoder * const e )
const bool best = ( e->matchfinder->match_len_limit > 12 ); const bool best = ( e->matchfinder->match_len_limit > 12 );
const int dis_price_count = best ? 1 : 512; const int dis_price_count = best ? 1 : 512;
const int align_price_count = best ? 1 : dis_align_size; const int align_price_count = best ? 1 : dis_align_size;
const int price_count = ( e->matchfinder->match_len_limit > 36 ) ? 1024 : 4096; const int price_count = ( e->matchfinder->match_len_limit > 36 ) ? 1013 : 4093;
int ahead, i; int ahead, i;
State * const state = &e->state; State * const state = &e->state;

View file

@ -111,7 +111,7 @@ int main( const int argc, const char * const argv[] )
if( out_size != in_size || memcmp( in_buffer + l, out_buffer, out_size ) ) if( out_size != in_size || memcmp( in_buffer + l, out_buffer, out_size ) )
{ {
fprintf( stderr, "lzcheck: Sync error at pos %d. in_size = %d, out_size = %d\n", fprintf( stderr, "lzcheck: Sync error at pos %d. in_size = %d, out_size = %d.\n",
l, in_size, out_size ); l, in_size, out_size );
for( i = 0; i < in_size; ++i ) for( i = 0; i < in_size; ++i )
fputc( in_buffer[l+i], stderr ); fputc( in_buffer[l+i], stderr );
@ -183,7 +183,7 @@ int main( const int argc, const char * const argv[] )
if( out_size != in_size || memcmp( in_buffer + l, out_buffer, out_size ) ) if( out_size != in_size || memcmp( in_buffer + l, out_buffer, out_size ) )
{ {
fprintf( stderr, "lzcheck: Sync error at pos %d. in_size = %d, out_size = %d\n", fprintf( stderr, "lzcheck: Sync error at pos %d. in_size = %d, out_size = %d.\n",
l, in_size, out_size ); l, in_size, out_size );
for( i = 0; i < in_size; ++i ) for( i = 0; i < in_size; ++i )
fputc( in_buffer[l+i], stderr ); fputc( in_buffer[l+i], stderr );

View file

@ -29,7 +29,7 @@
extern "C" { extern "C" {
#endif #endif
static const char * const LZ_version_string = "1.6-pre3"; static const char * const LZ_version_string = "1.6-pre4";
enum LZ_Errno { LZ_ok = 0, LZ_bad_argument, LZ_mem_error, enum LZ_Errno { LZ_ok = 0, LZ_bad_argument, LZ_mem_error,
LZ_sequence_error, LZ_header_error, LZ_unexpected_eof, LZ_sequence_error, LZ_header_error, LZ_unexpected_eof,

38
main.c
View file

@ -35,7 +35,7 @@
#include <unistd.h> #include <unistd.h>
#include <utime.h> #include <utime.h>
#include <sys/stat.h> #include <sys/stat.h>
#if defined(__MSVCRT__) || defined(_MSC_VER) #if defined(__MSVCRT__)
#include <io.h> #include <io.h>
#define fchmod(x,y) 0 #define fchmod(x,y) 0
#define fchown(x,y,z) 0 #define fchown(x,y,z) 0
@ -154,7 +154,7 @@ static void Pp_show_msg( struct Pretty_print * const pp, const char * const msg
for( i = 0; i < len; ++i ) fprintf( stderr, " " ); for( i = 0; i < len; ++i ) fprintf( stderr, " " );
if( !msg ) fflush( stderr ); if( !msg ) fflush( stderr );
} }
if( msg ) fprintf( stderr, "%s.\n", msg ); if( msg ) fprintf( stderr, "%s\n", msg );
} }
} }
@ -559,7 +559,7 @@ static int do_compress( struct LZ_Encoder * const encoder,
return 1; return 1;
} }
if( rd > 0 && rd != LZ_compress_write( encoder, buffer, rd ) ) if( rd > 0 && rd != LZ_compress_write( encoder, buffer, rd ) )
internal_error( "library error (LZ_compress_write)" ); internal_error( "library error (LZ_compress_write)." );
if( rd < size ) LZ_compress_finish( encoder ); if( rd < size ) LZ_compress_finish( encoder );
/* else LZ_compress_sync_flush( encoder ); */ /* else LZ_compress_sync_flush( encoder ); */
in_size += rd; in_size += rd;
@ -582,7 +582,7 @@ static int do_compress( struct LZ_Encoder * const encoder,
return 1; return 1;
} }
} }
else if( in_size == 0 ) internal_error( "library error (LZ_compress_read)" ); else if( in_size == 0 ) internal_error( "library error (LZ_compress_read)." );
if( LZ_compress_member_finished( encoder ) ) if( LZ_compress_member_finished( encoder ) )
{ {
unsigned long long size; unsigned long long size;
@ -597,7 +597,7 @@ static int do_compress( struct LZ_Encoder * const encoder,
{ {
close_and_set_permissions( in_statsp ); close_and_set_permissions( in_statsp );
if( !next_filename() ) if( !next_filename() )
{ Pp_show_msg( pp, "Too many volume files" ); return 1; } { Pp_show_msg( pp, "Too many volume files." ); return 1; }
if( !open_outstream( true ) ) return 1; if( !open_outstream( true ) ) return 1;
delete_output_on_interrupt = true; delete_output_on_interrupt = true;
} }
@ -650,9 +650,9 @@ int compress( const unsigned long long member_size,
if( !encoder || LZ_compress_errno( encoder ) != LZ_ok ) if( !encoder || LZ_compress_errno( encoder ) != LZ_ok )
{ {
if( !encoder || LZ_compress_errno( encoder ) == LZ_mem_error ) if( !encoder || LZ_compress_errno( encoder ) == LZ_mem_error )
Pp_show_msg( pp, "Not enough memory. Try a smaller dictionary size" ); Pp_show_msg( pp, "Not enough memory. Try a smaller dictionary size." );
else else
internal_error( "invalid argument to encoder" ); internal_error( "invalid argument to encoder." );
retval = 1; retval = 1;
} }
else retval = do_compress( encoder, member_size, volume_size, else retval = do_compress( encoder, member_size, volume_size,
@ -683,7 +683,7 @@ int do_decompress( struct LZ_Decoder * const decoder, const int infd,
return 1; return 1;
} }
if( in_size > 0 && in_size != LZ_decompress_write( decoder, buffer, in_size ) ) if( in_size > 0 && in_size != LZ_decompress_write( decoder, buffer, in_size ) )
internal_error( "library error (LZ_decompress_write)" ); internal_error( "library error (LZ_decompress_write)." );
if( in_size < max_in_size ) LZ_decompress_finish( decoder ); if( in_size < max_in_size ) LZ_decompress_finish( decoder );
} }
while( true ) while( true )
@ -733,16 +733,16 @@ int do_decompress( struct LZ_Decoder * const decoder, const int infd,
if( lz_errno == LZ_header_error || ( first_member && out_size == 0 ) ) if( lz_errno == LZ_header_error || ( first_member && out_size == 0 ) )
{ {
if( !first_member ) break; /* trailing garbage */ if( !first_member ) break; /* trailing garbage */
Pp_show_msg( pp, "Bad magic number (file not in lzip format)" ); Pp_show_msg( pp, "Bad magic number (file not in lzip format)." );
return 2; return 2;
} }
if( lz_errno == LZ_mem_error ) if( lz_errno == LZ_mem_error )
{ Pp_show_msg( pp, "Not enough memory" ); return 1; } { Pp_show_msg( pp, "Not enough memory." ); return 1; }
if( verbosity >= 0 ) if( verbosity >= 0 )
{ {
Pp_show_msg( pp, 0 ); Pp_show_msg( pp, 0 );
if( lz_errno == LZ_unexpected_eof ) if( lz_errno == LZ_unexpected_eof )
fprintf( stderr, "File ends unexpectedly at pos %llu\n", fprintf( stderr, "File ends unexpectedly at pos %llu.\n",
LZ_decompress_total_in_size( decoder ) ); LZ_decompress_total_in_size( decoder ) );
else else
fprintf( stderr, "Decoder error at pos %llu: %s.\n", fprintf( stderr, "Decoder error at pos %llu: %s.\n",
@ -753,7 +753,7 @@ int do_decompress( struct LZ_Decoder * const decoder, const int infd,
} }
if( LZ_decompress_finished( decoder ) == 1 ) break; if( LZ_decompress_finished( decoder ) == 1 ) break;
if( in_size == 0 && out_size == 0 ) if( in_size == 0 && out_size == 0 )
internal_error( "library error (LZ_decompress_read)" ); internal_error( "library error (LZ_decompress_read)." );
} }
return 0; return 0;
} }
@ -766,7 +766,7 @@ int decompress( const int infd, struct Pretty_print * const pp,
int retval; int retval;
if( !decoder || LZ_decompress_errno( decoder ) != LZ_ok ) if( !decoder || LZ_decompress_errno( decoder ) != LZ_ok )
{ Pp_show_msg( pp, "Not enough memory" ); retval = 1; } { Pp_show_msg( pp, "Not enough memory." ); retval = 1; }
else retval = do_decompress( decoder, infd, pp, testing ); else retval = do_decompress( decoder, infd, pp, testing );
LZ_decompress_close( decoder ); LZ_decompress_close( decoder );
@ -797,7 +797,7 @@ void show_error( const char * const msg, const int errcode, const bool help )
if( msg && msg[0] ) if( msg && msg[0] )
{ {
fprintf( stderr, "%s: %s", program_name, msg ); fprintf( stderr, "%s: %s", program_name, msg );
if( errcode > 0 ) fprintf( stderr, ": %s", strerror( errcode ) ); if( errcode > 0 ) fprintf( stderr, ": %s.", strerror( errcode ) );
fprintf( stderr, "\n" ); fprintf( stderr, "\n" );
} }
if( help ) if( help )
@ -810,7 +810,7 @@ void show_error( const char * const msg, const int errcode, const bool help )
void internal_error( const char * const msg ) void internal_error( const char * const msg )
{ {
if( verbosity >= 0 ) if( verbosity >= 0 )
fprintf( stderr, "%s: internal error: %s.\n", program_name, msg ); fprintf( stderr, "%s: internal error: %s\n", program_name, msg );
exit( 3 ); exit( 3 );
} }
@ -887,9 +887,9 @@ int main( const int argc, const char * const argv[] )
invocation_name = argv[0]; invocation_name = argv[0];
if( LZ_version()[0] != LZ_version_string[0] ) if( LZ_version()[0] != LZ_version_string[0] )
internal_error( "bad library version" ); internal_error( "bad library version." );
if( strcmp( PROGVERSION, LZ_version_string ) != 0 ) if( strcmp( PROGVERSION, LZ_version_string ) != 0 )
internal_error( "bad library version_string" ); internal_error( "bad library version_string." );
if( !ap_init( &parser, argc, argv, options, 0 ) ) if( !ap_init( &parser, argc, argv, options, 0 ) )
{ show_error( "Not enough memory.", 0, false ); return 1; } { show_error( "Not enough memory.", 0, false ); return 1; }
@ -925,11 +925,11 @@ int main( const int argc, const char * const argv[] )
case 't': program_mode = m_test; break; case 't': program_mode = m_test; break;
case 'v': if( verbosity < 4 ) ++verbosity; break; case 'v': if( verbosity < 4 ) ++verbosity; break;
case 'V': show_version(); return 0; case 'V': show_version(); return 0;
default : internal_error( "uncaught option" ); default : internal_error( "uncaught option." );
} }
} /* end process options */ } /* end process options */
#if defined(__MSVCRT__) || defined(__OS2__) || defined(_MSC_VER) #if defined(__MSVCRT__) || defined(__OS2__)
setmode( STDIN_FILENO, O_BINARY ); setmode( STDIN_FILENO, O_BINARY );
setmode( STDOUT_FILENO, O_BINARY ); setmode( STDOUT_FILENO, O_BINARY );
#endif #endif

View file

@ -30,25 +30,28 @@ fail=0
printf "testing lzlib-%s..." "$2" printf "testing lzlib-%s..." "$2"
"${LZIP}" -cqm4 in > /dev/null "${LZIP}" -cqm4 in > /dev/null
if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqm274 in > /dev/null "${LZIP}" -cqm274 in > /dev/null
if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqs-1 in > /dev/null "${LZIP}" -cqs-1 in > /dev/null
if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqs0 in > /dev/null "${LZIP}" -cqs0 in > /dev/null
if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqs4095 in > /dev/null "${LZIP}" -cqs4095 in > /dev/null
if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cqs513MiB in > /dev/null "${LZIP}" -cqs513MiB in > /dev/null
if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -tq in printf " in: Bad magic number (file not in lzip format).\n" > msg
if [ $? = 2 ] ; then printf . ; else fail=1 ; printf - ; fi "${LZIP}" -t in 2> out
"${LZIP}" -tq < in if [ $? = 2 ] && cmp out msg ; then printf . ; else printf - ; fail=1 ; fi
if [ $? = 2 ] ; then printf . ; else fail=1 ; printf - ; fi printf " (stdin): Bad magic number (file not in lzip format).\n" > msg
"${LZIP}" -t < in 2> out
if [ $? = 2 ] && cmp out msg ; then printf . ; else printf - ; fail=1 ; fi
rm -f out msg
"${LZIP}" -cdq in "${LZIP}" -cdq in
if [ $? = 2 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cdq < in "${LZIP}" -cdq < in
if [ $? = 2 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
dd if="${in_lz}" bs=1 count=6 2> /dev/null | "${LZIP}" -tq dd if="${in_lz}" bs=1 count=6 2> /dev/null | "${LZIP}" -tq
if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
dd if="${in_lz}" bs=1 count=20 2> /dev/null | "${LZIP}" -tq dd if="${in_lz}" bs=1 count=20 2> /dev/null | "${LZIP}" -tq
@ -65,7 +68,7 @@ cmp in copy || fail=1
printf . printf .
"${LZIP}" -cfq "${in_lz}" > out "${LZIP}" -cfq "${in_lz}" > out
if [ $? = 1 ] ; then printf . ; else fail=1 ; printf - ; fi if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${LZIP}" -cF -s16 "${in_lz}" > out || fail=1 "${LZIP}" -cF -s16 "${in_lz}" > out || fail=1
"${LZIP}" -cd out | "${LZIP}" -d > copy || fail=1 "${LZIP}" -cd out | "${LZIP}" -d > copy || fail=1
cmp in copy || fail=1 cmp in copy || fail=1