Skip to content

Commit c0d0212

Browse files
authored
ext/phar: remove phar_archive_data->alias == phar_archive_data->fname checks (#21820)
The phar_archive_data->alias field is only ever assigned a newly allocated char* or NULL, as such it can never be equal to the phar_archive_data->fname field, thus those comparisons are just confusing.
1 parent f63be32 commit c0d0212

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ext/phar/phar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ PHP_INI_END()
192192
*/
193193
void phar_destroy_phar_data(phar_archive_data *phar) /* {{{ */
194194
{
195-
if (phar->alias && phar->alias != phar->fname) {
195+
if (phar->alias) {
196196
pefree(phar->alias, phar->is_persistent);
197197
phar->alias = NULL;
198198
}

ext/phar/phar_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,7 @@ PHP_METHOD(Phar, getAlias)
26312631

26322632
PHAR_ARCHIVE_OBJECT();
26332633

2634-
if (phar_obj->archive->alias && phar_obj->archive->alias != phar_obj->archive->fname) {
2634+
if (phar_obj->archive->alias) {
26352635
RETURN_STRINGL(phar_obj->archive->alias, phar_obj->archive->alias_len);
26362636
}
26372637
}

0 commit comments

Comments
 (0)