com php-src: ext/phar support (incomplete): ext/phar/phar.c

From: Date: Mon, 12 May 2014 09:31:38 +0000
Subject: com php-src: ext/phar support (incomplete): ext/phar/phar.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78284@lists.php.net to get a copy of this message
Commit: dfb10145f7c4b56c761264aac3ee52e48f09fd55 Author: Dmitry Stogov <dmitry@zend.com> Mon, 12 May 2014 13:31:38 +0400 Parents: 1be957ebc9f86431abcad43e7c3f1e9b8b8c4dc8 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dfb10145f7c4b56c761264aac3ee52e48f09fd55 Log: ext/phar support (incomplete) Changed paths: M ext/phar/phar.c Diff: diff --git a/ext/phar/phar..c b/ext/phar/phar.c index 72c9518..72593df 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -376,9 +376,8 @@ static void destroy_phar_data(zval *zv) /* {{{ */ /** * destructor for the manifest hash, frees each file's entry */ -void destroy_phar_manifest_entry(zval *zv) /* {{{ */ +void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */ { - phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv); TSRMLS_FETCH(); if (entry->cfp) { @@ -427,6 +426,12 @@ void destroy_phar_manifest_entry(zval *zv) /* {{{ */ } /* }}} */ +void destroy_phar_manifest_entry(zval *zv) /* {{{ */ +{ + destroy_phar_manifest_entry_int(Z_PTR_P(zv)); +} +/* }}} */ + int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */ { int ret = 0; @@ -441,8 +446,8 @@ int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */ } /* if phar_get_or_create_entry_data returns a sub-directory, we have to free it */ if (idata->internal_file->is_temp_dir) { - destroy_phar_manifest_entry((void *)idata->internal_file); - efree(idata->internal_file); + destroy_phar_manifest_entry_int(idata->internal_file); +//??? efree(idata->internal_file); } } @@ -3015,8 +3020,8 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, phar_set_32(entry_buffer+20, entry->metadata_str.s ? entry->metadata_str.s->len : 0); if (sizeof(entry_buffer) != php_stream_write(newfile, entry_buffer, sizeof(entry_buffer)) - || !entry->metadata_str.s - || entry->metadata_str.s->len != php_stream_write(newfile, entry->metadata_str.s->val, entry->metadata_str.s->len)) { + || (entry->metadata_str.s && + entry->metadata_str.s->len != php_stream_write(newfile, entry->metadata_str.s->val, entry->metadata_str.s->len))) { if (closeoldfile) { php_stream_close(oldfile); }

« previous php.cvs (#78284) next »