diff options
author | Steph Fox <sfox@php.net> | 2008-06-20 16:29:36 +0000 |
---|---|---|
committer | Steph Fox <sfox@php.net> | 2008-06-20 16:29:36 +0000 |
commit | 97cf2a15da955e5a5cfae76979d89bdcf84047a1 (patch) | |
tree | 773bf81264be50d1790dfba7c5c552ffc5ce3b80 | |
parent | 5fe790929d0a6bc9563a43c64e7ad168312825f2 (diff) | |
download | php-git-97cf2a15da955e5a5cfae76979d89bdcf84047a1.tar.gz |
- 5_2 compatibility stuff (so we can stay in sync with PECL)
-rw-r--r-- | ext/phar/util.c | 2 | ||||
-rw-r--r-- | ext/phar/zip.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ext/phar/util.c b/ext/phar/util.c index 8f39cd61ab..043aad7b14 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -336,7 +336,7 @@ splitted: efree(entry); if (*filename == '.') { - phar_archive_data **pphar; + phar_archive_data **pphar = NULL; int try_len; if (FAILURE == phar_get_archive(pphar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) { diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 1651580fe7..636360b90f 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -213,11 +213,15 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, if (phar_parse_metadata(&metadata, &mydata->metadata, PHAR_GET_16(locator.comment_len) TSRMLS_CC) == FAILURE) { mydata->metadata_len = 0; /* if not valid serialized data, it is a regular string */ +#if PHP_VERSION_ID >= 50300 if (entry.is_persistent) { ALLOC_PERMANENT_ZVAL(mydata->metadata); } else { ALLOC_ZVAL(mydata->metadata); } +#else + ALLOC_ZVAL(mydata->metadata); +#endif INIT_ZVAL(*mydata->metadata); metadata = pestrndup(metadata, PHAR_GET_16(locator.comment_len), mydata->is_persistent); ZVAL_STRINGL(mydata->metadata, metadata, PHAR_GET_16(locator.comment_len), 0); @@ -405,11 +409,15 @@ foundit: if (phar_parse_metadata(&p, &(entry.metadata), PHAR_GET_16(zipentry.comment_len) TSRMLS_CC) == FAILURE) { entry.metadata_len = 0; /* if not valid serialized data, it is a regular string */ +#if PHP_VERSION_ID >= 50300 if (entry.is_persistent) { ALLOC_PERMANENT_ZVAL(entry.metadata); } else { ALLOC_ZVAL(entry.metadata); } +#else + ALLOC_ZVAL(entry.metadata); +#endif INIT_ZVAL(*entry.metadata); ZVAL_STRINGL(entry.metadata, pestrndup(buf, PHAR_GET_16(zipentry.comment_len), entry.is_persistent), PHAR_GET_16(zipentry.comment_len), 0); } |