mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00
- MFB: restore overwrite feature (regression introduced in 5.2.8)
This commit is contained in:
parent
14f2f4148c
commit
d00fb8b360
1 changed files with 7 additions and 3 deletions
|
@ -65,10 +65,14 @@ zip_open(const char *fn, int flags, int *zep)
|
|||
struct zip_cdir *cdir;
|
||||
int i;
|
||||
off_t len;
|
||||
|
||||
|
||||
|
||||
switch (_zip_file_exists(fn, flags, zep)) {
|
||||
case -1:
|
||||
return NULL;
|
||||
if (!(flags & ZIP_OVERWRITE)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
case 0:
|
||||
return _zip_allocate_new(fn, zep);
|
||||
default:
|
||||
|
@ -440,7 +444,7 @@ _zip_file_exists(const char *fn, int flags, int *zep)
|
|||
}
|
||||
|
||||
if (stat(fn, &st) != 0) {
|
||||
if (flags & ZIP_CREATE)
|
||||
if (flags & ZIP_CREATE || flags & ZIP_OVERWRITE)
|
||||
return 0;
|
||||
else {
|
||||
set_error(zep, NULL, ZIP_ER_OPEN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue