mirror of
https://github.com/simplex-chat/zip.git
synced 2026-06-03 09:17:33 +00:00
72970d9e47
As per zip spec we may want to encode host version. This version is used by e.g. the unzip utility in order to understand how to interpret external info (type of files and permissions). Current algorithm is pretty naive, we do not test for all OS versions supported by zip. Instead we check if we run on windows and put 0 in that case (MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems). Otherwise we put 3 (UNIX). This way code works properly on the unix OS, and we keep old behavior for the other OS. Note that we didn't change ‘toVersion’ function, as it already masked the higher byte where OS information was stored. This code was tested manually by storing archive and then unarchiving it via unzip. There is no automated test because such test would require external tools (unzip).