Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libarchive-clib/build/autoconf/ltsugar.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2024 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
Expand Down
4 changes: 2 additions & 2 deletions libarchive-clib/c/archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* assert that ARCHIVE_VERSION_NUMBER >= 2012108.
*/
/* Note: Compiler will complain if this does not match archive_entry.h! */
#define ARCHIVE_VERSION_NUMBER 3008006
#define ARCHIVE_VERSION_NUMBER 3008007

#include <sys/stat.h>
#include <stddef.h> /* for wchar_t */
Expand Down Expand Up @@ -177,7 +177,7 @@ __LA_DECL int archive_version_number(void);
/*
* Textual name/version of the library, useful for version displays.
*/
#define ARCHIVE_VERSION_ONLY_STRING "3.8.6"
#define ARCHIVE_VERSION_ONLY_STRING "3.8.7"
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
__LA_DECL const char * archive_version_string(void);

Expand Down
4 changes: 2 additions & 2 deletions libarchive-clib/c/archive_check_magic.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ __archive_check_magic(struct archive *a, unsigned int magic,
if (!handle_type) {
errmsg("PROGRAMMER ERROR: Function ");
errmsg(function);
errmsg(" invoked with invalid archive handle.\n");
errmsg(" invoked with invalid archive handle\n");
diediedie();
}

if (a->magic != magic) {
archive_set_error(a, -1,
"PROGRAMMER ERROR: Function '%s' invoked"
" on '%s' archive object, which is not supported.",
" on '%s' archive object, which is not supported",
function,
handle_type);
a->state = ARCHIVE_STATE_FATAL;
Expand Down
2 changes: 1 addition & 1 deletion libarchive-clib/c/archive_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define ARCHIVE_ENTRY_H_INCLUDED

/* Note: Compiler will complain if this does not match archive.h! */
#define ARCHIVE_VERSION_NUMBER 3008006
#define ARCHIVE_VERSION_NUMBER 3008007

/*
* Note: archive_entry.h is for use outside of libarchive; the
Expand Down
4 changes: 3 additions & 1 deletion libarchive-clib/c/archive_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ _archive_set_either_option(struct archive *a, const char *m, const char *o, cons
if (r2 == ARCHIVE_FATAL)
return (ARCHIVE_FATAL);

if (r2 == ARCHIVE_WARN - 1)
if (r1 == ARCHIVE_WARN - 1)
return r2;
if (r2 == ARCHIVE_WARN -1)
return r1;
return r1 > r2 ? r1 : r2;
}
Expand Down
4 changes: 2 additions & 2 deletions libarchive-clib/c/archive_pathmatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pm(const char *p, const char *s, int flags)
if (*p == '\0')
return (1);
while (*s) {
if (archive_pathmatch(p, s, flags))
if (pm(p, s, flags))
return (1);
++s;
}
Expand Down Expand Up @@ -307,7 +307,7 @@ pm_w(const wchar_t *p, const wchar_t *s, int flags)
if (*p == L'\0')
return (1);
while (*s) {
if (archive_pathmatch_w(p, s, flags))
if (pm_w(p, s, flags))
return (1);
++s;
}
Expand Down
22 changes: 11 additions & 11 deletions libarchive-clib/c/archive_ppmd8.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ typedef struct CPpmd8_Node_

#define EMPTY_NODE 0xFFFFFFFF

void Ppmd8_Construct(CPpmd8 *p)
static void Ppmd8_Construct(CPpmd8 *p)
{
unsigned i, k, m;

Expand Down Expand Up @@ -89,14 +89,14 @@ void Ppmd8_Construct(CPpmd8 *p)
}
}

void Ppmd8_Free(CPpmd8 *p)
static void Ppmd8_Free(CPpmd8 *p)
{
free(p->Base);
p->Size = 0;
p->Base = 0;
}

Bool Ppmd8_Alloc(CPpmd8 *p, UInt32 size)
static Bool Ppmd8_Alloc(CPpmd8 *p, UInt32 size)
{
if (p->Base == 0 || p->Size != size)
{
Expand Down Expand Up @@ -407,7 +407,7 @@ static void RestartModel(CPpmd8 *p)
}
}

void Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod)
static void Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod)
{
p->MaxOrder = maxOrder;
p->RestoreMethod = restoreMethod;
Expand Down Expand Up @@ -1042,7 +1042,7 @@ static void Rescale(CPpmd8 *p)
p->FoundState = STATS(p->MinContext);
}

CPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked1, UInt32 *escFreq)
static CPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked1, UInt32 *escFreq)
{
CPpmd_See *see;
if (p->MinContext->NumStats != 0xFF)
Expand Down Expand Up @@ -1078,7 +1078,7 @@ static void NextContext(CPpmd8 *p)
}
}

void Ppmd8_Update1(CPpmd8 *p)
static void Ppmd8_Update1(CPpmd8 *p)
{
CPpmd_State *s = p->FoundState;
s->Freq += 4;
Expand All @@ -1093,7 +1093,7 @@ void Ppmd8_Update1(CPpmd8 *p)
NextContext(p);
}

void Ppmd8_Update1_0(CPpmd8 *p)
static void Ppmd8_Update1_0(CPpmd8 *p)
{
p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
p->RunLength += p->PrevSuccess;
Expand All @@ -1103,15 +1103,15 @@ void Ppmd8_Update1_0(CPpmd8 *p)
NextContext(p);
}

void Ppmd8_UpdateBin(CPpmd8 *p)
static void Ppmd8_UpdateBin(CPpmd8 *p)
{
p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
p->PrevSuccess = 1;
p->RunLength++;
NextContext(p);
}

void Ppmd8_Update2(CPpmd8 *p)
static void Ppmd8_Update2(CPpmd8 *p)
{
p->MinContext->SummFreq += 4;
if ((p->FoundState->Freq += 4) > MAX_FREQ)
Expand All @@ -1127,7 +1127,7 @@ This code is based on:
PPMd var.I (2002): Dmitry Shkarin : Public domain
Carryless rangecoder (1999): Dmitry Subbotin : Public domain */

Bool Ppmd8_RangeDec_Init(CPpmd8 *p)
static Bool Ppmd8_RangeDec_Init(CPpmd8 *p)
{
unsigned i;
p->Low = 0;
Expand Down Expand Up @@ -1161,7 +1161,7 @@ static void RangeDec_Decode(CPpmd8 *p, UInt32 start, UInt32 size)

#define MASK(sym) ((signed char *)charMask)[sym]

int Ppmd8_DecodeSymbol(CPpmd8 *p)
static int Ppmd8_DecodeSymbol(CPpmd8 *p)
{
size_t charMask[256 / sizeof(size_t)];
if (p->MinContext->NumStats != 0)
Expand Down
25 changes: 0 additions & 25 deletions libarchive-clib/c/archive_ppmd8_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ typedef struct
UInt16 BinSumm[25][64];
} CPpmd8;

void Ppmd8_Construct(CPpmd8 *p);
Bool Ppmd8_Alloc(CPpmd8 *p, UInt32 size);
void Ppmd8_Free(CPpmd8 *p);
void Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod);
#define Ppmd8_WasAllocated(p) ((p)->Base != NULL)


/* ---------- Internal Functions ---------- */

Expand All @@ -104,30 +98,11 @@ extern const Byte PPMD8_kExpEscape[16];
#define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
#endif

void Ppmd8_Update1(CPpmd8 *p);
void Ppmd8_Update1_0(CPpmd8 *p);
void Ppmd8_Update2(CPpmd8 *p);
void Ppmd8_UpdateBin(CPpmd8 *p);

#define Ppmd8_GetBinSumm(p) \
&p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]

CPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked, UInt32 *scale);


/* ---------- Decode ---------- */

Bool Ppmd8_RangeDec_Init(CPpmd8 *p);
#define Ppmd8_RangeDec_IsFinishedOK(p) ((p)->Code == 0)
int Ppmd8_DecodeSymbol(CPpmd8 *p); /* returns: -1 as EndMarker, -2 as DataError */

/* ---------- Encode ---------- */

#define Ppmd8_RangeEnc_Init(p) { (p)->Low = 0; (p)->Range = 0xFFFFFFFF; }
void Ppmd8_RangeEnc_FlushData(CPpmd8 *p);
void Ppmd8_EncodeSymbol(CPpmd8 *p, int symbol); /* symbol = -1 means EndMarker */

typedef struct
{
Expand Down
12 changes: 6 additions & 6 deletions libarchive-clib/c/archive_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static int64_t
client_skip_proxy(struct archive_read_filter *self, int64_t request)
{
if (request < 0)
__archive_errx(1, "Negative skip requested.");
__archive_errx(1, "Negative skip requested");
if (request == 0)
return 0;

Expand Down Expand Up @@ -379,7 +379,7 @@ archive_read_set_callback_data2(struct archive *_a, void *client_data,
if (a->client.dataset == NULL)
{
archive_set_error(&a->archive, ENOMEM,
"No memory.");
"No memory");
return ARCHIVE_FATAL;
}
a->client.nodes = 1;
Expand All @@ -388,7 +388,7 @@ archive_read_set_callback_data2(struct archive *_a, void *client_data,
if (iindex > a->client.nodes - 1)
{
archive_set_error(&a->archive, EINVAL,
"Invalid index specified.");
"Invalid index specified");
return ARCHIVE_FATAL;
}
a->client.dataset[iindex].data = client_data;
Expand All @@ -409,14 +409,14 @@ archive_read_add_callback_data(struct archive *_a, void *client_data,
"archive_read_add_callback_data");
if (iindex > a->client.nodes) {
archive_set_error(&a->archive, EINVAL,
"Invalid index specified.");
"Invalid index specified");
return ARCHIVE_FATAL;
}
p = realloc(a->client.dataset, sizeof(*a->client.dataset)
* (++(a->client.nodes)));
if (p == NULL) {
archive_set_error(&a->archive, ENOMEM,
"No memory.");
"No memory");
return ARCHIVE_FATAL;
}
a->client.dataset = (struct archive_read_data_node *)p;
Expand Down Expand Up @@ -625,7 +625,7 @@ _archive_read_next_header2(struct archive *_a, struct archive_entry *entry)
r1 = archive_read_data_skip(&a->archive);
if (r1 == ARCHIVE_EOF)
archive_set_error(&a->archive, EIO,
"Premature end-of-file.");
"Premature end-of-file");
if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
a->archive.state = ARCHIVE_STATE_FATAL;
return (ARCHIVE_FATAL);
Expand Down
4 changes: 4 additions & 0 deletions libarchive-clib/c/archive_read_append_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ archive_read_append_filter(struct archive *_a, int code)
strcpy(str, "lrzip");
r1 = archive_read_support_filter_lrzip(_a);
break;
case ARCHIVE_FILTER_GRZIP:
strcpy(str, "grzip");
r1 = archive_read_support_filter_grzip(_a);
break;
default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
"Invalid filter code specified");
Expand Down
6 changes: 3 additions & 3 deletions libarchive-clib/c/archive_read_disk_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_path_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
Expand Down Expand Up @@ -1035,7 +1035,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_time_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
Expand All @@ -1061,7 +1061,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_owner_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
Expand Down
6 changes: 3 additions & 3 deletions libarchive-clib/c/archive_read_disk_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_path_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
Expand Down Expand Up @@ -1019,7 +1019,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_time_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
Expand All @@ -1045,7 +1045,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_owner_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
Expand Down
2 changes: 1 addition & 1 deletion libarchive-clib/c/archive_read_support_filter_grzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ archive_read_support_filter_grzip(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;

if (__archive_read_register_bidder(a, NULL, NULL,
if (__archive_read_register_bidder(a, NULL, "grzip",
&grzip_bidder_vtable) != ARCHIVE_OK)
return (ARCHIVE_FATAL);

Expand Down
4 changes: 2 additions & 2 deletions libarchive-clib/c/archive_read_support_filter_lz4.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ lz4_filter_read(struct archive_read_filter *self, const void **p)
case READ_LEGACY_STREAM:
/* Reading a lz4 stream already failed. */
archive_set_error(&self->archive->archive,
ARCHIVE_ERRNO_MISC, "Invalid sequence.");
ARCHIVE_ERRNO_MISC, "Invalid sequence");
return (ARCHIVE_FATAL);
case READ_DEFAULT_BLOCK:
ret = lz4_filter_read_default_stream(self, p);
Expand All @@ -377,7 +377,7 @@ lz4_filter_read(struct archive_read_filter *self, const void **p)
break;
default:
archive_set_error(&self->archive->archive,
ARCHIVE_ERRNO_MISC, "Program error.");
ARCHIVE_ERRNO_MISC, "Program error");
return (ARCHIVE_FATAL);
}

Expand Down
2 changes: 1 addition & 1 deletion libarchive-clib/c/archive_read_support_filter_lzop.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ archive_read_support_filter_lzop(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;

if (__archive_read_register_bidder(a, NULL, NULL,
if (__archive_read_register_bidder(a, NULL, "lzop",
&lzop_bidder_vtable) != ARCHIVE_OK)
return (ARCHIVE_FATAL);

Expand Down
Loading
Loading