1
0
Fork 0

Adding upstream version 0.8.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-20 14:58:19 +01:00
parent 2c6d5ecc7e
commit 4502486013
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
7 changed files with 26 additions and 16 deletions

View file

@ -1,3 +1,8 @@
2016-01-23 Antonio Diaz Diaz <antonio@gnu.org>
* Version 0.8 released.
* Documented that lzip does not use 'literal_pos_state_bits'.
2015-07-07 Antonio Diaz Diaz <antonio@gnu.org>
* Version 0.7 released.
@ -33,7 +38,7 @@
* Version 0.1 released.
Copyright (C) 2013-2015 Antonio Diaz Diaz.
Copyright (C) 2013-2016 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

View file

@ -50,7 +50,7 @@ After running 'configure', you can run 'make' and 'make install' as
explained above.
Copyright (C) 2013-2015 Antonio Diaz Diaz.
Copyright (C) 2013-2016 Antonio Diaz Diaz.
This file is free documentation: you have unlimited permission to copy,
distribute and modify it.

5
NEWS
View file

@ -1,3 +1,4 @@
Changes in version 0.7:
Changes in version 0.8:
Minor changes.
It has been documented that lzip does not use the LZMA parameter
'literal_pos_state_bits'.

2
README
View file

@ -45,7 +45,7 @@ range encoding), and Igor Pavlov (for putting all the above together in
LZMA).
Copyright (C) 2013-2015 Antonio Diaz Diaz.
Copyright (C) 2013-2016 Antonio Diaz Diaz.
This file is free documentation: you have unlimited permission to copy,
distribute and modify it.

10
configure vendored
View file

@ -1,12 +1,12 @@
#! /bin/sh
# configure script for Lzd - Educational decompressor for the lzip format
# Copyright (C) 2013-2015 Antonio Diaz Diaz.
# Copyright (C) 2013-2016 Antonio Diaz Diaz.
#
# This configure script is free software: you have unlimited permission
# to copy, distribute and modify it.
pkgname=lzd
pkgversion=0.7
pkgversion=0.8
progname=lzd
srctrigger=lzd.cc
@ -139,7 +139,7 @@ if [ -z "${no_create}" ] ; then
rm -f config.status
cat > config.status << EOF
#! /bin/sh
# This file was generated automatically by configure. Do not edit.
# This file was generated automatically by configure. Don't edit.
# Run this file to recreate the current configuration.
#
# This script is free software: you have unlimited permission
@ -165,8 +165,8 @@ echo "LDFLAGS = ${LDFLAGS}"
rm -f Makefile
cat > Makefile << EOF
# Makefile for Lzd - Educational decompressor for the lzip format
# Copyright (C) 2013-2015 Antonio Diaz Diaz.
# This file was generated automatically by configure. Do not edit.
# Copyright (C) 2013-2016 Antonio Diaz Diaz.
# This file was generated automatically by configure. Don't edit.
#
# This Makefile is free software: you have unlimited permission
# to copy, distribute and modify it.

14
lzd.cc
View file

@ -1,5 +1,5 @@
/* Lzd - Educational decompressor for the lzip format
Copyright (C) 2013-2015 Antonio Diaz Diaz.
Copyright (C) 2013-2016 Antonio Diaz Diaz.
This program is free software: you have unlimited permission
to copy, distribute and modify it.
@ -52,6 +52,7 @@ enum {
min_dictionary_size = 1 << 12,
max_dictionary_size = 1 << 29,
literal_context_bits = 3,
literal_pos_state_bits = 0, // not used
pos_state_bits = 2,
pos_states = 1 << pos_state_bits,
pos_state_mask = pos_states - 1,
@ -238,6 +239,7 @@ class LZ_decoder
unsigned pos; // current pos in buffer
unsigned stream_pos; // first byte not yet written to stdout
uint32_t crc_;
bool pos_wrapped;
void flush_data();
@ -262,7 +264,8 @@ public:
buffer( new uint8_t[dictionary_size] ),
pos( 0 ),
stream_pos( 0 ),
crc_( 0xFFFFFFFFU )
crc_( 0xFFFFFFFFU ),
pos_wrapped( false )
{ buffer[dictionary_size-1] = 0; } // prev_byte of first byte
~LZ_decoder() { delete[] buffer; }
@ -284,7 +287,8 @@ void LZ_decoder::flush_data()
if( std::fwrite( buffer + stream_pos, 1, size, stdout ) != size )
{ std::fprintf( stderr, "Write error: %s\n", std::strerror( errno ) );
std::exit( 1 ); }
if( pos >= dictionary_size ) { partial_data_pos += pos; pos = 0; }
if( pos >= dictionary_size )
{ partial_data_pos += pos; pos = 0; pos_wrapped = true; }
stream_pos = pos;
}
}
@ -380,7 +384,7 @@ bool LZ_decoder::decode_member() // Returns false if error
}
}
state.set_match();
if( rep0 >= dictionary_size || rep0 >= data_position() )
if( rep0 >= dictionary_size || ( rep0 >= pos && !pos_wrapped ) )
{ flush_data(); return false; }
}
for( int i = 0; i < len; ++i ) put_byte( peek( rep0 ) );
@ -402,7 +406,7 @@ int main( const int argc, const char * const argv[] )
"It is not safe to use lzd for any real work.\n"
"\nUsage: %s < file.lz > file\n", argv[0] );
std::printf( "Lzd decompresses from standard input to standard output.\n"
"\nCopyright (C) 2015 Antonio Diaz Diaz.\n"
"\nCopyright (C) 2016 Antonio Diaz Diaz.\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"
"Report bugs to lzip-bug@nongnu.org\n"

View file

@ -1,6 +1,6 @@
#! /bin/sh
# check script for Lzd - Educational decompressor for lzip files
# Copyright (C) 2013-2015 Antonio Diaz Diaz.
# Copyright (C) 2013-2016 Antonio Diaz Diaz.
#
# This script is free software: you have unlimited permission
# to copy, distribute and modify it.