cellog Sat Jan 27 18:57:11 2007 UTC
Modified files:
/pecl/phar phar.c
Log:
php_stream_truncate_set_size() is a noop with temp streams.
so, we're going to use a brand new tempfile for truncation.
ALL TESTS PASS NOW (finally)
http://cvs.php.net/viewvc.cgi/pecl/phar/phar.c?r1=1.145&r2=1.146&diff_format=u
Index: pecl/phar/phar.c
diff -u pecl/phar/phar.c:1.145 pecl/phar/phar.c:1.146
--- pecl/phar/phar.c:1.145 Sat Jan 27 18:45:47 2007
+++ pecl/phar/phar.c Sat Jan 27 18:57:11 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: phar.c,v 1.145 2007/01/27 18:45:47 cellog Exp $ */
+/* $Id: phar.c,v 1.146 2007/01/27 18:57:11 cellog Exp $ */
#define PHAR_MAIN
#include "phar_internal.h"
@@ -293,9 +293,9 @@
(*ret)->internal_file = entry;
if (entry->fp) {
/* make a copy */
- (*ret)->fp = entry->fp;
if (for_trunc) {
- php_stream_truncate_set_size(entry->fp,
0);
+ php_stream_close(entry->fp);
+ entry->fp = php_stream_fopen_tmpfile();
entry->is_modified = 1;
phar->is_modified = 1;
/* reset file size */
@@ -305,6 +305,7 @@
} else if (for_append) {
php_stream_seek(entry->fp, 0, SEEK_END);
}
+ (*ret)->fp = entry->fp;
} else {
(*ret)->fp = 0;
if (for_write) {
@@ -2643,7 +2644,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar API version", PHAR_VERSION_STR);
- php_info_print_table_row(2, "CVS revision", "$Revision: 1.145 $");
+ php_info_print_table_row(2, "CVS revision", "$Revision: 1.146 $");
php_info_print_table_row(2, "gzip compression",
#if HAVE_ZLIB
"enabled");
|