Workaround for a bug introduced by Apple's last update

This commit is contained in:
Ariel Abreu 2023-08-17 12:00:15 -04:00
parent aea2151947
commit 887bd4f42e
No known key found for this signature in database
GPG Key ID: 5B88AAAF4280706F

View File

@ -283,6 +283,12 @@ xar_t xar_open_digest_verify(const char *file, int32_t flags, void *expected_toc
} }
XAR(ret)->heap_fd = -1; XAR(ret)->heap_fd = -1;
#ifdef DARLING
// BUG: a recent update to Apple's code introduced a bug because it assumes
// that dirname is always set, even when only reading. to work around this,
// let's always set the dirname.
XAR(ret)->dirname = xar_safe_dirname(file);
#endif
inflateInit(&XAR(ret)->zs); inflateInit(&XAR(ret)->zs);
if( XAR(ret)->fd < 0 ) { if( XAR(ret)->fd < 0 ) {
xar_close(ret); xar_close(ret);