diff options
Diffstat (limited to 'ext/zip/lib/zip_close.c')
-rw-r--r-- | ext/zip/lib/zip_close.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c index b5eca67a46..b3379cfae5 100644 --- a/ext/zip/lib/zip_close.c +++ b/ext/zip/lib/zip_close.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 @@ -84,7 +84,7 @@ zip_close(zip_t *za) } zip_discard(za); return 0; - } + } if (!changed) { zip_discard(za); @@ -95,7 +95,7 @@ zip_close(zip_t *za) zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); return -1; } - + if ((filelist=(zip_filelist_t *)malloc(sizeof(filelist[0])*(size_t)survivors)) == NULL) return -1; @@ -109,7 +109,7 @@ zip_close(zip_t *za) zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); return -1; } - + filelist[j].idx = i; j++; } @@ -124,7 +124,7 @@ zip_close(zip_t *za) free(filelist); return -1; } - + error = 0; for (j=0; j<survivors; j++) { int new_data; @@ -223,7 +223,7 @@ zip_close(zip_t *za) } zip_discard(za); - + return 0; } @@ -237,7 +237,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de) int ret; int is_zip64; zip_flags_t flags; - + if (zip_source_stat(src, &st) < 0) { _zip_error_set_from_source(&za->error, src); return -1; @@ -266,7 +266,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de) flags |= ZIP_FL_FORCE_ZIP64; else { de->uncomp_size = st.size; - + if ((st.valid & ZIP_STAT_COMP_SIZE) == 0) { if (( ((de->comp_method == ZIP_CM_DEFLATE || ZIP_CM_IS_DEFAULT(de->comp_method)) && st.size > MAX_DEFLATE_SIZE_32) || (de->comp_method != ZIP_CM_STORE && de->comp_method != ZIP_CM_DEFLATE && !ZIP_CM_IS_DEFAULT(de->comp_method)))) @@ -289,7 +289,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de) if (st.comp_method == ZIP_CM_STORE || (ZIP_CM_IS_DEFAULT(de->comp_method) && st.comp_method != de->comp_method)) { zip_source_t *s_store, *s_crc; zip_compression_implementation comp_impl; - + if (st.comp_method != ZIP_CM_STORE) { if ((comp_impl=_zip_get_compression_implementation(st.comp_method)) == NULL) { zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); @@ -338,7 +338,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de) } ret = copy_source(za, s2); - + if (zip_source_stat(s2, &st) < 0) ret = -1; @@ -374,14 +374,14 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de) if ((ret=_zip_dirent_write(za, de, flags)) < 0) return -1; - + if (is_zip64 != ret) { /* Zip64 mismatch between preliminary file header written before data and final file header written afterwards */ zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); return -1; } - + if (zip_source_seek_write(za->src, offend, SEEK_SET) < 0) { _zip_error_set_from_source(&za->error, za->src); return -1; @@ -406,7 +406,7 @@ copy_data(zip_t *za, zip_uint64_t len) if (_zip_write(za, buf, n) < 0) { return -1; } - + len -= n; } @@ -433,14 +433,14 @@ copy_source(zip_t *za, zip_source_t *src) break; } } - + if (n < 0) { _zip_error_set_from_source(&za->error, src); ret = -1; } zip_source_close(src); - + return ret; } @@ -449,7 +449,7 @@ static int write_cdir(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivors) { zip_int64_t cd_start, end, size; - + if ((cd_start = zip_source_tell_write(za->src)) < 0) { return -1; } @@ -457,7 +457,7 @@ write_cdir(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivors) if ((size=_zip_cdir_write(za, filelist, survivors)) < 0) { return -1; } - + if ((end = zip_source_tell_write(za->src)) < 0) { return -1; } |