]> granicus.if.org Git - php/commitdiff
Fixed bug#52013 (Unable to decompress files in a compressed phar)
authorHannes Magnusson <bjori@php.net>
Mon, 29 Aug 2011 14:19:54 +0000 (14:19 +0000)
committerHannes Magnusson <bjori@php.net>
Mon, 29 Aug 2011 14:19:54 +0000 (14:19 +0000)
ext/phar/phar.c

index 866eb41b188babc88ba20ca1f923ebeef07c02a6..c45efbf44171e5d9d59e9942f7520d7ac02839fa 100644 (file)
@@ -3101,9 +3101,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert,
                /* this will have changed for all files that have either changed compression or been modified */
                entry->offset = entry->offset_abs = offset;
                offset += entry->compressed_filesize;
-               phar_stream_copy_to_stream(file, newfile, entry->compressed_filesize, &wrote);
-
-               if (entry->compressed_filesize != wrote) {
+               if (phar_stream_copy_to_stream(file, newfile, entry->compressed_filesize, &wrote) == FAILURE) {
                        if (closeoldfile) {
                                php_stream_close(oldfile);
                        }