1
0
Fork 0

Merging upstream version 1.7~pre1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 22:19:41 +01:00
parent f037c4d308
commit 0ce9f5ee70
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
14 changed files with 115 additions and 69 deletions

View file

@ -1,5 +1,5 @@
/* Lunzip - Decompressor for lzip files
Copyright (C) 2010, 2011, 2012, 2013, 2014 Antonio Diaz Diaz.
Copyright (C) 2010-2015 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
@ -259,14 +259,14 @@ void LZd_flush_data( struct LZ_decoder * const d );
int seek_read( const int fd, uint8_t * const buf, const int size,
const int offset );
static inline uint8_t LZd_get_prev_byte( const struct LZ_decoder * const d )
static inline uint8_t LZd_peek1( const struct LZ_decoder * const d )
{
const int i = ( ( d->pos > 0 ) ? d->pos : d->buffer_size ) - 1;
return d->buffer[i];
}
static inline uint8_t LZd_get_byte( const struct LZ_decoder * const d,
const int distance )
static inline uint8_t LZd_peek( const struct LZ_decoder * const d,
const int distance )
{
uint8_t b;
const int i = d->pos - distance - 1;
@ -319,7 +319,7 @@ static inline void LZd_copy_block2( struct LZ_decoder * const d,
}
}
for( ; len > 0; --len )
LZd_put_byte( d, LZd_get_byte( d, distance ) );
LZd_put_byte( d, LZd_peek( d, distance ) );
}
static inline bool LZd_init( struct LZ_decoder * const d,
@ -348,7 +348,6 @@ static inline bool LZd_init( struct LZ_decoder * const d,
Bm_array_init( d->bm_dis_slot[0], len_states * (1 << dis_slot_bits) );
Bm_array_init( d->bm_dis, modeled_distances - end_dis_model );
Bm_array_init( d->bm_align, dis_align_size );
Lm_init( &d->match_len_model );
Lm_init( &d->rep_len_model );
d->buffer[d->buffer_size-1] = 0; /* prev_byte of first byte */