Skip to content

Commit

Permalink
Fix build failure for zip phars
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonAndre committed Jul 15, 2020
1 parent 3aac351 commit 43cceb3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ext/phar/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,10 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{
PHAR_SET_32(local.crc32, entry->crc32);
continue_dir:
/* set file metadata */
phar_metadata_tracker_try_ensure_has_serialized_data(&entry->metadata_tracker, entry->is_persistent);
if (phar_metadata_tracker_has_data(&entry->metadata_tracker)) {
phar_metadata_tracker_try_ensure_has_serialized_data(&entry->metadata_tracker, entry->is_persistent);
PHAR_SET_16(central.comment_len, entry->metadata_tracker.str ? ZSTR_LEN(entry->metadata_tracker.str) : 0);
}

entry->header_offset = php_stream_tell(p->filefp);
offset = entry->header_offset + sizeof(local) + entry->filename_len + (entry->is_dir ? 1 : 0) + sizeof(perms);
Expand Down Expand Up @@ -1436,7 +1439,6 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int

phar_metadata_tracker_try_ensure_has_serialized_data(&phar->metadata_tracker, phar->is_persistent);
if (phar->metadata_tracker.str) {
// TODO implement
/* set phar metadata */
PHAR_SET_16(eocd.comment_len, ZSTR_LEN(phar->metadata_tracker.str));

Expand Down

0 comments on commit 43cceb3

Please sign in to comment.