]> granicus.if.org Git - php/commitdiff
- Cannot change stream here
authorMarcus Boerger <helly@php.net>
Sat, 27 Jan 2007 19:42:37 +0000 (19:42 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 27 Jan 2007 19:42:37 +0000 (19:42 +0000)
ext/phar/phar.c

index 22a523b68b47f3234476c3118f7205709f777093..e44efa36e3d31f4ca4f821b0dedeb9fef6423933 100644 (file)
@@ -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 */