Browse Source

[macOS export] Set correct external file attributes (Unix mode), and creation time.

(cherry picked from commit accae11fe3f28e1da27b67346f3303f68160a375)
bruvzg 5 years ago
parent
commit
14b8124074
1 changed files with 3 additions and 2 deletions
  1. 3 2
      platform/osx/export/export.cpp

+ 3 - 2
platform/osx/export/export.cpp

@@ -749,14 +749,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,