diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-25 13:36:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-25 13:36:25 +0000 |
commit | 74ffb1c96335d84fce50806b5313fce38a82cb10 (patch) | |
tree | d74d1b7076e0a7bc39aba2f7c70d361c09eaef1d /decoder.c | |
parent | Releasing debian version 1.11-10. (diff) | |
download | lunzip-74ffb1c96335d84fce50806b5313fce38a82cb10.tar.xz lunzip-74ffb1c96335d84fce50806b5313fce38a82cb10.zip |
Merging upstream version 1.12.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'decoder.c')
-rw-r--r-- | decoder.c | 38 |
1 files changed, 18 insertions, 20 deletions
@@ -1,18 +1,18 @@ -/* Lunzip - Decompressor for the lzip format - Copyright (C) 2010-2019 Antonio Diaz Diaz. +/* Lunzip - Decompressor for the lzip format + Copyright (C) 2010-2021 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 - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. + 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 + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define _FILE_OFFSET_BITS 64 @@ -104,9 +104,8 @@ void LZd_flush_data( struct LZ_decoder * const d ) writeblock( d->outfd, d->buffer + d->stream_pos, size ) != size ) { show_error( "Write error", errno, false ); cleanup_and_fail( 1 ); } if( d->pos >= d->buffer_size ) - { d->partial_data_pos += d->pos; d->pos = 0; d->pos_wrapped = true; - if( d->partial_data_pos >= d->dictionary_size ) - d->pos_wrapped_dic = true; } + { d->partial_data_pos += d->pos; d->pos = 0; + if( d->partial_data_pos >= d->dictionary_size ) d->pos_wrapped = true; } d->stream_pos = d->pos; } } @@ -173,16 +172,15 @@ static bool LZd_verify_trailer( struct LZ_decoder * const d, { if( verbosity >= 4 ) show_header( d->dictionary_size ); if( data_size == 0 || member_size == 0 ) - fputs( "no data compressed. ", stderr ); + fputs( "no data compressed. ", stderr ); else - fprintf( stderr, "%6.3f:1, %5.2f%% ratio, %5.2f%% saved. ", + fprintf( stderr, "%6.3f:1, %5.2f%% ratio, %5.2f%% saved. ", (double)data_size / member_size, ( 100.0 * member_size ) / data_size, 100.0 - ( ( 100.0 * member_size ) / data_size ) ); if( verbosity >= 4 ) fprintf( stderr, "CRC %08X, ", td_crc ); if( verbosity >= 3 ) - fprintf( stderr, "decompressed %9llu, compressed %8llu. ", - data_size, member_size ); + fprintf( stderr, "%9llu out, %8llu in. ", data_size, member_size ); } return true; } @@ -320,7 +318,7 @@ int LZd_decode_member( struct LZ_decoder * const d, rep3 = rep2; rep2 = rep1; rep1 = rep0; rep0 = distance; state = St_set_match( state ); if( rep0 >= d->dictionary_size || - ( rep0 >= LZd_data_position( d ) && !d->pos_wrapped_dic ) ) + ( !d->pos_wrapped && rep0 >= LZd_data_position( d ) ) ) { LZd_flush_data( d ); return 1; } } copy_block( d, rep0, len ); |