From: Greg Beaver Date: Tue, 12 Feb 2008 05:28:06 +0000 (+0000) Subject: fix remaining broken tests broken by the addition of phar->fp closing X-Git-Tag: RELEASE_2_0_0a1~513 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3234e78ca114b305f6eba9dc6783f9761a4850d8;p=php fix remaining broken tests broken by the addition of phar->fp closing --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index c255bdb3b4..8c6a5a1a04 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -214,9 +214,11 @@ int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */ } return 1; } else if (!phar->refcount) { - if (phar->fp) { + if (phar->fp && !(phar->flags & PHAR_FILE_COMPRESSION_MASK)) { /* close open file handle - allows removal or rename of - the file on windows, which has greedy locking */ + the file on windows, which has greedy locking + only close if the archive was not already compressed. If it + was compressed, then the fp does not refer to the original file */ php_stream_close(phar->fp); phar->fp = NULL; }