From: Pierre Joye Date: Thu, 1 Jan 2009 19:32:45 +0000 (+0000) Subject: - restore overwrite feature (regression introduced in 5.2.8) X-Git-Tag: php-5.2.9RC1~173 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=597f0acfaa292e4ca089b1132d9fcedf215c485d;p=php - restore overwrite feature (regression introduced in 5.2.8) --- diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c index 10c5e1e6d8..0880eef2c6 100644 --- a/ext/zip/lib/zip_open.c +++ b/ext/zip/lib/zip_open.c @@ -68,7 +68,10 @@ zip_open(const char *fn, int flags, int *zep) switch (_zip_file_exists(fn, flags, zep)) { case -1: + if (!(flags & ZIP_OVERWRITE)) { return NULL; + } + case 0: return _zip_allocate_new(fn, zep); default: @@ -440,7 +443,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);