diff options
author | Pierre Joye <pajoye@php.net> | 2009-07-19 15:21:13 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2009-07-19 15:21:13 +0000 |
commit | 19059ef91ef32b7c6bf5be4f2bd3a5fa9f9e201e (patch) | |
tree | ab21b5b776ed3885c2b911adec3efc5f770dd2a1 | |
parent | e03540f80eb21014c0d4ae7ffece268bb8fcc663 (diff) | |
download | php-git-19059ef91ef32b7c6bf5be4f2bd3a5fa9f9e201e.tar.gz |
- MF53
-rw-r--r-- | ext/zip/lib/zip.h | 10 | ||||
-rw-r--r-- | ext/zip/lib/zip_add.c | 2 | ||||
-rw-r--r-- | ext/zip/lib/zip_close.c | 27 | ||||
-rw-r--r-- | ext/zip/lib/zip_filerange_crc.c | 2 | ||||
-rw-r--r-- | ext/zip/lib/zip_get_archive_flag.c | 2 | ||||
-rw-r--r-- | ext/zip/lib/zip_open.c | 7 | ||||
-rw-r--r-- | ext/zip/lib/zip_set_archive_flag.c | 2 |
7 files changed, 26 insertions, 26 deletions
diff --git a/ext/zip/lib/zip.h b/ext/zip/lib/zip.h index e63ee7c7a7..14a57bc582 100644 --- a/ext/zip/lib/zip.h +++ b/ext/zip/lib/zip.h @@ -20,7 +20,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -39,11 +39,11 @@ #ifdef PHP_WIN32 # include "zip_win32.h" -# ifdef PHP_ZIP_EXPORTS +# ifdef PHP_ZIP_EXPORTS # define ZIP_EXTERN(rt) __declspec(dllexport)rt _stdcall -# else +# else # define ZIP_EXTERN(rt) rt -# endif +# endif #elif defined(__GNUC__) && __GNUC__ >= 4 # define ZIP_EXTERN(rt) __attribute__ ((visibility("default"))) rt #else @@ -217,7 +217,7 @@ ZIP_EXTERN(struct zip_source *)zip_source_filep(struct zip *, FILE *, off_t, off_t); ZIP_EXTERN(void) zip_source_free(struct zip_source *); ZIP_EXTERN(struct zip_source *)zip_source_function(struct zip *, - zip_source_callback, void *); + zip_source_callback, void *); ZIP_EXTERN(struct zip_source *)zip_source_zip(struct zip *, struct zip *, int, int, off_t, off_t); ZIP_EXTERN(int) zip_stat(struct zip *, const char *, int, struct zip_stat *); diff --git a/ext/zip/lib/zip_add.c b/ext/zip/lib/zip_add.c index 3afb1768f7..85d5997911 100644 --- a/ext/zip/lib/zip_add.c +++ b/ext/zip/lib/zip_add.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c index 289ca7afb3..7f93cc94e1 100644 --- a/ext/zip/lib/zip_close.c +++ b/ext/zip/lib/zip_close.c @@ -229,11 +229,10 @@ zip_close(struct zip *za) zs = NULL; if (!ZIP_ENTRY_DATA_CHANGED(za->entry+i)) { - if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1)) - == NULL) { - error = 1; - break; - } + if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1)) == NULL) { + error = 1; + break; + } } if (add_data(za, zs ? zs : za->entry[i].source, &de, out) < 0) { @@ -286,19 +285,19 @@ zip_close(struct zip *za) return -1; } - if (za->zp) { - fclose(za->zp); - za->zp = NULL; - reopen_on_error = 1; + if (za->zp) { + fclose(za->zp); + za->zp = NULL; + reopen_on_error = 1; } if (_zip_rename(temp, za->zn) != 0) { _zip_error_set(&za->error, ZIP_ER_RENAME, errno); remove(temp); free(temp); - if (reopen_on_error) { - /* ignore errors, since we're already in an error case */ - za->zp = fopen(za->zn, "rb"); - } + if (reopen_on_error) { + /* ignore errors, since we're already in an error case */ + za->zp = fopen(za->zn, "rb"); + } return -1; } mask = umask(0); @@ -638,7 +637,7 @@ _zip_create_temp_output(struct zip *za, FILE **outp) FILE *tfp; int len = strlen(za->zn) + 8; - if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) { + if ((temp=(char *)malloc(len)) == NULL) { _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return NULL; } diff --git a/ext/zip/lib/zip_filerange_crc.c b/ext/zip/lib/zip_filerange_crc.c index 4d1ad56692..c6890987b1 100644 --- a/ext/zip/lib/zip_filerange_crc.c +++ b/ext/zip/lib/zip_filerange_crc.c @@ -1,6 +1,6 @@ /* zip_filerange_crc.c -- compute CRC32 for a range of a file - Copyright (C) 2008 Dieter Baron and Thomas Klausner + Copyright (C) 2008-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> diff --git a/ext/zip/lib/zip_get_archive_flag.c b/ext/zip/lib/zip_get_archive_flag.c index 2d46aa39ff..a595c51f59 100644 --- a/ext/zip/lib/zip_get_archive_flag.c +++ b/ext/zip/lib/zip_get_archive_flag.c @@ -1,6 +1,6 @@ /* zip_get_archive_flag.c -- get archive global flag - Copyright (C) 2008 Dieter Baron and Thomas Klausner + Copyright (C) 2008-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> diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c index 4b219556c8..e3840197dd 100644 --- a/ext/zip/lib/zip_open.c +++ b/ext/zip/lib/zip_open.c @@ -69,15 +69,16 @@ zip_open(const char *fn, int flags, int *zep) if (flags & ZIP_OVERWRITE) { return _zip_allocate_new(fn, zep); } - + switch (_zip_file_exists(fn, flags, zep)) { case -1: if (!(flags & ZIP_OVERWRITE)) { - return NULL; + return NULL; } - + case 0: return _zip_allocate_new(fn, zep); + default: break; } diff --git a/ext/zip/lib/zip_set_archive_flag.c b/ext/zip/lib/zip_set_archive_flag.c index a6fdd8d2d0..20316e4614 100644 --- a/ext/zip/lib/zip_set_archive_flag.c +++ b/ext/zip/lib/zip_set_archive_flag.c @@ -1,6 +1,6 @@ /* zip_get_archive_flag.c -- set archive global flag - Copyright (C) 2008 Dieter Baron and Thomas Klausner + Copyright (C) 2008-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> |