Merging upstream version 1.10.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
7ed3b78bc0
commit
5aac003d1d
16 changed files with 352 additions and 181 deletions
10
decoder.h
10
decoder.h
|
@ -1,5 +1,5 @@
|
|||
/* Lunzip - Decompressor for the lzip format
|
||||
Copyright (C) 2010-2017 Antonio Diaz Diaz.
|
||||
Copyright (C) 2010-2018 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
|
||||
|
@ -244,11 +244,7 @@ unsigned seek_read_back( const int fd, uint8_t * const buf, const int size,
|
|||
const int offset );
|
||||
|
||||
static inline uint8_t LZd_peek_prev( const struct LZ_decoder * const d )
|
||||
{
|
||||
if( d->pos > 0 ) return d->buffer[d->pos-1];
|
||||
if( d->pos_wrapped ) return d->buffer[d->buffer_size-1];
|
||||
return 0; /* prev_byte of first byte */
|
||||
}
|
||||
{ return d->buffer[((d->pos > 0) ? d->pos : d->buffer_size)-1]; }
|
||||
|
||||
static inline uint8_t LZd_peek( const struct LZ_decoder * const d,
|
||||
const unsigned distance )
|
||||
|
@ -338,6 +334,8 @@ static inline bool LZd_init( struct LZ_decoder * const d,
|
|||
d->outfd = ofd;
|
||||
d->pos_wrapped = false;
|
||||
d->pos_wrapped_dic = false;
|
||||
/* prev_byte of first byte; also for LZd_peek( 0 ) on corrupt file */
|
||||
d->buffer[d->buffer_size-1] = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue