From: Marcus Boerger Date: Sat, 27 Jan 2007 19:42:37 +0000 (+0000) Subject: - Cannot change stream here X-Git-Tag: RELEASE_1_0_0RC1~114 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7523db97f791a993168b3999e2508010cbaa8d2;p=php - Cannot change stream here --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 22a523b68b..e44efa36e3 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -294,8 +294,7 @@ static int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len if (entry->fp) { /* make a copy */ if (for_trunc) { - php_stream_close(entry->fp); - entry->fp = php_stream_fopen_tmpfile(); + php_stream_truncate_set_size(entry->fp, 0); entry->is_modified = 1; phar->is_modified = 1; /* reset file size */