mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00
initial libzip upgrade patch to 0.10.1
This commit is contained in:
parent
7cae4ff02c
commit
335a11b14b
64 changed files with 2720 additions and 695 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
zip_replace.c -- replace file via callback function
|
||||
Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <libzip@nih.at>
|
||||
|
@ -38,9 +38,9 @@
|
|||
|
||||
|
||||
ZIP_EXTERN(int)
|
||||
zip_replace(struct zip *za, int idx, struct zip_source *source)
|
||||
zip_replace(struct zip *za, zip_uint64_t idx, struct zip_source *source)
|
||||
{
|
||||
if (idx < 0 || idx >= za->nentry || source == NULL) {
|
||||
if (idx >= za->nentry || source == NULL) {
|
||||
_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
|
||||
return -1;
|
||||
}
|
||||
|
@ -54,11 +54,18 @@ zip_replace(struct zip *za, int idx, struct zip_source *source)
|
|||
|
||||
|
||||
|
||||
int
|
||||
_zip_replace(struct zip *za, int idx, const char *name,
|
||||
/* NOTE: Signed due to -1 on error. See zip_add.c for more details. */
|
||||
|
||||
zip_int64_t
|
||||
_zip_replace(struct zip *za, zip_uint64_t idx, const char *name,
|
||||
struct zip_source *source)
|
||||
{
|
||||
if (idx == -1) {
|
||||
if (ZIP_IS_RDONLY(za)) {
|
||||
_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (idx == ZIP_UINT64_MAX) {
|
||||
if (_zip_entry_new(za) == NULL)
|
||||
return -1;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue