Merge pull request #39977 from bruvzg/fix_zip_file_mode_again

[macOS export] Set correct external file attributes, and creation time.
This commit is contained in:
Rémi Verschelde 2020-06-30 09:57:45 +02:00 committed by GitHub
commit bccb323396
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -825,14 +825,15 @@ void EditorExportPlatformOSX::_zip_folder_recursive(zipFile &p_zip, const String
zipfi.tmz_date.tm_hour = time.hour;
zipfi.tmz_date.tm_mday = date.day;
zipfi.tmz_date.tm_min = time.min;
zipfi.tmz_date.tm_mon = date.month;
zipfi.tmz_date.tm_mon = date.month - 1; // Note: "tm" month range - 0..11, Godot month range - 1..12, http://www.cplusplus.com/reference/ctime/tm/
zipfi.tmz_date.tm_sec = time.sec;
zipfi.tmz_date.tm_year = date.year;
zipfi.dosDate = 0;
// 0100000: regular file type
// 0000755: permissions rwxr-xr-x
// 0000644: permissions rw-r--r--
zipfi.external_fa = (is_executable ? 0100755 : 0100644) << 16L;
uint32_t _mode = (is_executable ? 0100755 : 0100644);
zipfi.external_fa = (_mode << 16L) | !(_mode & 0200);
zipfi.internal_fa = 0;
zipOpenNewFileInZip4(p_zip,